These are chat archives for spyder-ide/public

20th
Aug 2015
Steven Silvester
@blink1073
Aug 20 2015 00:11
what’s the issue?
tonyVeco
@tonyVeco
Aug 20 2015 00:14
I am doing something not so common, like creating PIL plugins to read a specific type of image file that is not a standard one ( png, jpeg, etc...)
I created that plugin and then to use it I had just to add it in the PIL library , adding both the .py and the .pyc files
this is what I did in Eclipse , and then by doing that I really could read my type of image and get the value of each pixel
Steven Silvester
@blink1073
Aug 20 2015 00:18
as in, you used your PIL plugin from Eclipse?
tonyVeco
@tonyVeco
Aug 20 2015 00:18
I added my plugin to the PIL package used by Eclipse
in the PIL package there is a list of plugin that are included by default
what I did was simply to put in it also my plugin and it works ;)
Steven Silvester
@blink1073
Aug 20 2015 00:22
I don’t understand where Eclipse comes into play, you mean you put the code in your site-packages/PIL directory?
tonyVeco
@tonyVeco
Aug 20 2015 00:22
yes exaclty
exactly
because I started working in eclipse for my project
Steven Silvester
@blink1073
Aug 20 2015 00:23
so the code you were running in Eclipse is not working in Spyder?
tonyVeco
@tonyVeco
Aug 20 2015 00:23
yes, that is the problem
I added my plugin even in the PIL directory of Spyder because I moved to Anaconda
Steven Silvester
@blink1073
Aug 20 2015 00:25
to be clear, you put it in the site-packages/PIL directory in your conda environment?
tonyVeco
@tonyVeco
Aug 20 2015 00:25
yes exactly
Steven Silvester
@blink1073
Aug 20 2015 00:27
specifically, this directory: python -c "import site; print(site.getsitepackages()[0])”
tonyVeco
@tonyVeco
Aug 20 2015 00:31
yes+
Steven Silvester
@blink1073
Aug 20 2015 00:32
what OS are you using?
tonyVeco
@tonyVeco
Aug 20 2015 00:32
Linux openSuse
Steven Silvester
@blink1073
Aug 20 2015 00:32
how are you launching spyder?
tonyVeco
@tonyVeco
Aug 20 2015 00:32
from linux console
the result of course is that the image extension is not recognized yet
as if I had not put any plugin..
Steven Silvester
@blink1073
Aug 20 2015 00:34
using the spyder command?
tonyVeco
@tonyVeco
Aug 20 2015 00:34
yes
Steven Silvester
@blink1073
Aug 20 2015 00:34
does which spyder match your anaconda path?
tonyVeco
@tonyVeco
Aug 20 2015 00:35
i check
/home/antonio/anaconda/bin/spyder
this is the output
Steven Silvester
@blink1073
Aug 20 2015 00:37
does your code work when run as a script python <myscript.py>?
tonyVeco
@tonyVeco
Aug 20 2015 00:38
you mean if I try to run one of my scripts from linux console?
Steven Silvester
@blink1073
Aug 20 2015 00:39
yes
tonyVeco
@tonyVeco
Aug 20 2015 00:40
yes it works, I have just tried even a complex script that imported skimage and matplotlib ;)
Steven Silvester
@blink1073
Aug 20 2015 00:41
from the console in spyder, what is the output of import site; print(site.getsitepackages()[0])
tonyVeco
@tonyVeco
Aug 20 2015 00:41
I go to see
/home/antonio/anaconda/lib/python2.7/site-packages/
tonyVeco
@tonyVeco
Aug 20 2015 00:47
and I swear that the plugin works in eclipse, I am just trying to move to Anaconda the pipeline I created in Eclipse
Steven Silvester
@blink1073
Aug 20 2015 00:47
I’m really stumped if it works from the command line but not from within spyder, despite using the same paths
tonyVeco
@tonyVeco
Aug 20 2015 00:48
on the command line I tried another script not the one giving problems
you meant to try the problematic script from command?
Steven Silvester
@blink1073
Aug 20 2015 00:49
yes, please
tonyVeco
@tonyVeco
Aug 20 2015 00:50
oh, sorry!! wait, I try it!!
yes, of course same problem
Steven Silvester
@blink1073
Aug 20 2015 00:52
okay, so we ruled out spyder at least :smile:
tonyVeco
@tonyVeco
Aug 20 2015 00:52
lolll
Steven Silvester
@blink1073
Aug 20 2015 00:52
and are you using Pillow?
tonyVeco
@tonyVeco
Aug 20 2015 00:52
yes
Steven Silvester
@blink1073
Aug 20 2015 00:52
and also in Eclipse?
tonyVeco
@tonyVeco
Aug 20 2015 00:53
yes
I also tried to read a jpeg image in spyder with the pil library and it works
so it gets access to the library in the correct way
Steven Silvester
@blink1073
Aug 20 2015 00:53
just fun funsies, try removing your pyc file
tonyVeco
@tonyVeco
Aug 20 2015 00:54
I added it today after seeing I had problems, but i can remove it now ;)
Steven Silvester
@blink1073
Aug 20 2015 00:54
the pyc is a temporary thing, and often the source of subtle problems
tonyVeco
@tonyVeco
Aug 20 2015 00:56
same result :D
all the scripts and the image files are in a spyder project of course
Steven Silvester
@blink1073
Aug 20 2015 00:57
that shouldn’t matter if you’re just running a script from the command line
I’m afraid I’m out of ideas, and its time for me to put the kids to bed. You could try a PIL github issue, or perhaps the Anaconda mailing list
Pilllow* not PIL
tonyVeco
@tonyVeco
Aug 20 2015 00:59
oh don't worry, you really gave me a lot of time
thanks so much
Steven Silvester
@blink1073
Aug 20 2015 01:00
sorry I couldn’t be of more help, cheers!
tonyVeco
@tonyVeco
Aug 20 2015 01:00
no problem!!!
bye!!!!
tonyVeco
@tonyVeco
Aug 20 2015 22:52
I found the problem!! and the solution!! we can talk about it whenever you want and if you want
:D :D :D :D