Re: imshow keeps crashhing
On Wed, Jan 6, 2016, at 18:37, William Ray Wing wrote: > Is this a typo or did you really mean /private/vars? That is, did your > create a “vars” directory under /private at some point in the past > (pre-Yosemite)? The usual directory there would be /var > > In any case, the whole /private directory tree is now part of the SIP > (System Integrity Protection) system under Yosemite, and to open and > manipulate files there you will have to either turn SIP off or jump > through hoops. If you do a ls -al in /private, you will see that var is /private/var/folders/.. is for per-user temporary directories [default value of TMPDIR], and the directories in question are writable by the users and not affected by SIP. But it's hidden (since people aren't expected to actually want to navigate to their temporary files - how often do you actually go look for something in /tmp?). I would suggest creating his files in the desktop or documents folder if he wants to be able to interactively use the files. -- https://mail.python.org/mailman/listinfo/python-list
Re: imshow keeps crashhing
I think I figured out the real problem, you can see my post here: http://stackoverflow.com/questions/34645512/scipy-imshow-conflict-with-el-capitan-sip-and-var-folders/34646093#34646093 Thanks again for helping to guide me in the right direction. -- https://mail.python.org/mailman/listinfo/python-list
Re: imshow keeps crashhing
Sorry you were right the path is in: /vars/folders not /private/var/folders. -- https://mail.python.org/mailman/listinfo/python-list
Re: imshow keeps crashhing
Thanks William and John, So the full path that scipy is using is: /private/var/folders/w4/wrnzszgd41d7064lx64nc10hgn/T/ I can't recall specifically adding the /var directory under /private. William - do you know how I can make scipy write temporary files in a non SIP folder? Thanks so much, Darren -- https://mail.python.org/mailman/listinfo/python-list
Re: imshow keeps crashhing
> On Jan 6, 2016, at 6:10 PM, darren.mcaf...@gmail.com wrote: > > Thanks for the quick reply! > > So scipy is making temporary files in /private/vars/folders/w4/ name>/ Is this a typo or did you really mean /private/vars? That is, did your create a “vars” directory under /private at some point in the past (pre-Yosemite)? The usual directory there would be /var In any case, the whole /private directory tree is now part of the SIP (System Integrity Protection) system under Yosemite, and to open and manipulate files there you will have to either turn SIP off or jump through hoops. If you do a ls -al in /private, you will see that var is drwxr-xr-x 29 root wheel 986 Oct 23 11:20 var note the “root” and “wheel” owner and group names. I’d suggest moving your tests to a different directory that isn’t part of SIP, and debug there. If you MUST work under /private, you will have your work cut out for you. -Bill > > 1. When in the correct folder within Terminal, on the command line I can do: >open > And it will open it in Preivew. > > 2. However, when opening Preview first, it is impossible (for me) to navigate > to the /private directory to open the file that way, even with: >defaults write com.apple.Finder AppleShowAllFiles YES > turned on. > > 3. When I run imshow() (my attempt to 'launch Preview from scipy as you > suggested). The UID of the process is 501, which is the same as when I do > echo $UID. So I'm assuming the launched Preview is running as myself. > > 4. When the temporary file is originally created its permissions are -rw-- > > Does any of that information help? Thanks again. > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: imshow keeps crashhing
In darren.mcaf...@gmail.com writes: > So scipy is making temporary files in > /private/vars/folders/w4// Are there any unusual characters in ? That's usually more of a Windows issue, but I'm grasping at straws here :-) > 1. When in the correct folder within Terminal, on the command line I can do: > open > And it will open it in Preivew. So the actual command name for running Preview is "open"? Have you tried setting the SCIPY_PIL_IMAGE_VIEWER variable to that name? > 2. However, when opening Preview first, it is impossible (for me) to navigate > to the /private directory to open the file that way, even with: > defaults write com.apple.Finder AppleShowAllFiles YES > turned on. You mean you can't use Preview's file-selection interface to select the desired file? The /private directory is not navigable? Does it even show up as a choice? Is there something special about the /private directory? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list
Re: imshow keeps crashhing
Thanks for the quick reply! So scipy is making temporary files in /private/vars/folders/w4// 1. When in the correct folder within Terminal, on the command line I can do: open And it will open it in Preivew. 2. However, when opening Preview first, it is impossible (for me) to navigate to the /private directory to open the file that way, even with: defaults write com.apple.Finder AppleShowAllFiles YES turned on. 3. When I run imshow() (my attempt to 'launch Preview from scipy as you suggested). The UID of the process is 501, which is the same as when I do echo $UID. So I'm assuming the launched Preview is running as myself. 4. When the temporary file is originally created its permissions are -rw-- Does any of that information help? Thanks again. -- https://mail.python.org/mailman/listinfo/python-list
Re: imshow keeps crashhing
In darren.mcaf...@gmail.com writes: > Hi John, > I am on a mac and have set the following: > SCIPY_PIL_IMAGE_VIEWER=/Applications/Preview.app/Contents/MacOS/Preview > And when using imshow(), sure enough Preview attempts to open the fie, > but it throws the following error: The file "tmp1zuvo7wn.png" couldn't be > opened because you don't have permission to view it. > I can open the temporary file manually no problem. And I have played > around with chmod 0644 , but nothing seems to work. > I have a feeling this is El Capitan specific. Do you have any > suggestions? I don't really know much about Macs... Can you run Preview and open the temporary file successfully? When launched from scipy, Does Preview run as a user other than yourself? What are the permissions on the temporary file when it's originally created? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list
Re: imshow keeps crashhing
Hi John, I am on a mac and have set the following: SCIPY_PIL_IMAGE_VIEWER=/Applications/Preview.app/Contents/MacOS/Preview And when using imshow(), sure enough Preview attempts to open the fie, but it throws the following error: The file "tmp1zuvo7wn.png" couldn't be opened because you don't have permission to view it. I can open the temporary file manually no problem. And I have played around with chmod 0644 , but nothing seems to work. I have a feeling this is El Capitan specific. Do you have any suggestions? -- https://mail.python.org/mailman/listinfo/python-list
Re: imshow keeps crashhing
In norou...@gmail.com writes: > Can anyone please help me with "imshow"? I have tried "imshow" on different > computers and different Python consoles but it does not work. Here are the > code and the error message: > import scipy.misc as mi > img = mi.imread('C:\images\circles.png') > mi.imshow(img) > 'see' is not recognized as an internal or external command, > operable program or batch file. scipy calls an external image viewer program to display the image. The name of this program is stored in the environment variable SCIPY_PIL_IMAGE_VIEWER. If that variable is not present, it uses 'see' by default. Do you have a suitable image viewing program installed on your computer? If so, try setting the SCIPY_PIL_IMAGE_VIEWER environment variable to the name of that program. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list
imshow keeps crashhing
Hello everyone, Can anyone please help me with "imshow"? I have tried "imshow" on different computers and different Python consoles but it does not work. Here are the code and the error message: import scipy.misc as mi img = mi.imread('C:\images\circles.png') mi.imshow(img) 'see' is not recognized as an internal or external command, operable program or batch file. Traceback (most recent call last): File "", line 1, in File "C:\...\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile execfile(filename, namespace) File "C:\...\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc) File "C:/.../.spyder2/temp.py", line 11, in mi.imshow(img) File "C:\...\Anaconda2\lib\site-packages\scipy\misc\pilutil.py", line 389, in imshow raise RuntimeError('Could not execute image viewer.') RuntimeError: Could not execute image viewer. Thanks a lot for your time. Ahmad -- https://mail.python.org/mailman/listinfo/python-list