-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ValueError: insecure string pickle #5314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That is odd and I can not reproduce locally. Also pretty sure that we smoke test this on travis. Can you do a bit more debugging and sort out what the value of the arguments being passed to |
Great advice thanks! Had to install |
I'm going to reopen this. It still might be nice to get a better error message (about the missing dependencies) rather than the "insecure string pickle" message. I'll see if I can reproduce in an environment without |
I'm having trouble reproducing the problem as well -- even with the brew python on a Mac as you are doing. Still would be nice to make this more friendly, but not sure where to start. |
Sorry I had a messed up configuration so I wouldn't be of much help as to how to reproduce. I only know that |
I'm having a similar issue. Installing
,which seems a known problem with virtual environments? The workaround suggested there aren't very clean solutions. Reverting back to version 1.4.3, and reverting every other package I had to previous working stage, I get the same error as above. The only major thing that has changed is upgrading my OSX to El Capitan. I use a virtual environment and this is the error I get:
|
Oh, Macs . Does this work if you use |
With regards to the framework issue the only thing that has changed is that we now actually check for a framework build and error out. With 1.4.3 you would just get a broken half working implementation that cant be forgrounded and has non working buttons etc. I am sorry that the workarounds are non clean to you but I spent a fair amount of time looking for better ones and as far as I know there are none. This is really a bug in virtualenv and there is little we can do about it since the GUI frameworks just don't work in a non framework build. You can try a different backend which might work without a framework build (not wx thou which have a similar check build in) From the trackeback it seems like you are running OSX system python. Personally I have never had anything but issues with that and would strongly recommend installing an alternative python and leave the system version alone. |
@mdboom Macs, very true! Ever since upgrading to El Capitan, I've been regretting it. @jenshnielsen Sorry for my lack of knowledge in this area, but I had a couple of questions. I actually believe I have a python framework and I'm running that version instead of system's python. I have installed python through homebrew. I also tried running out of the virtual environment today but still got the BTW, this is the error I'm getting. @mdboom you're right. Maybe I should use a different backend, but I wasn't sure how to enforce a certain backend:
|
The main problem with system python is that it ships old versions of numpy and matplotlib (1.3rc... afaik) since this is a system file you cant uninstall it. Sometimes it interferes with the newly installed matplotlib. Homebrew python don't use these files and thus gets round this issue. Homebrew python should be build as a framework and behave as expected. But when virtualenv creates a new environment it never creates a framework build even if created from a framework python. You can enforce a backend in a couple of different ways see http://matplotlib.org/faq/usage_faq.html#what-is-a-backend The pickle issue seems to be the same as #5386 could you try running from a python process? import subprocess
p = subprocess.Popen(['foo'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.communicate() And see if that raises an insecure string pickle warning? |
this issue for youtube download is similar ytdl-org/youtube-dl#6840 |
I tried running the above command from python command line. It wasn't a virtual environment, but I still get the |
Thanks that confirms the observation from #5386 and the youtube-dl bug. I don't expect this bug to be limited to virtualenvs or any specific version of matplotlib. It does seem to be specific to el capitan thou. Basically when python is calling a non existing subprocess (such as the non existing program foo) it gets the error report back via a pickle string. For some reason this string gets terminated on el Capitan for some reason. The other issue with the frameworks build is specific to virtualenvs and is really caused by how python in a virtual env can interact with OSX and is not specific to any resent version of OSX. |
brew install fontconfig That fixed the issue for me. |
|
I have a new machine setup, and I'm getting the problem again. And yes, the code ... import subprocess
p = subprocess.Popen(['foo'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.communicate() gives me the |
Ah, I found the problem (for my install): brew install imagemagick I dug into the errors python was showing ... $ python -c "import matplotlib.animation"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/matplotlib/animation.py", line 578, in <module>
class ImageMagickWriter(MovieWriter, ImageMagickBase):
File "/usr/local/lib/python2.7/site-packages/matplotlib/animation.py", line 74, in wrapper
if writerClass.isAvailable():
File "/usr/local/lib/python2.7/site-packages/matplotlib/animation.py", line 277, in isAvailable
creationflags=subprocess_creation_flags)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1334, in _execute_child
child_exception = pickle.loads(data)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1388, in loads
return Unpickler(file).load()
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 864, in load
dispatch[key](self)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 972, in load_string
raise ValueError, "insecure string pickle"
ValueError: insecure string pickle
$ And noticed ImageMagick was being used. Given the comments in this thread about missing dependencies, I installed ImageMagick and the issue went away. |
@icedawn Can you check if subprocess32 gives a more meaningful error message? You will need to pip install it first.
@RafaelCosman you are probably missing another dependency. Can you try to provide some more information about what you are trying to do? |
Yes @jenshnielsen ... subprocess32 generates a clear error message --
|
#6576 tries to work around this issue (which is really a bug in python2.7) by using subprocess32 it would be great if anyone has the time to test it out |
Looks like this will finally be fixed in python 2.712 https://hg.python.org/cpython/raw-file/v2.7.12rc1/Misc/NEWS
|
Running on Capitan, i had the same error, when i
|
I had the same error...resolved after restarting the mac. |
2.0 will require |
When I run
python -c "import matplotlib.animation"
, I get:I'm using Python 2.7.10, matplotlib 1.4.3. Can you help?
The text was updated successfully, but these errors were encountered: