I'm having trouble installing python packets using pip in a virtualenv. After some investigations, it turns out there seems to be a problem with PyYaml. I downloaded the last version and tried to build it. When using the "system" python, there is no problem. However, when I try to run the same command (python setup.py install) after activating my virtualenv, I get the following error:
gcc -bundle -bundle_loader python.exe -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib - L/Users/a/.pyenv/versions/2.7.7/lib build/temp.macosx-10.10-x86_64-2.7/ext/_yaml.o -lyaml -o build/lib.macosx-10.10-x86_64-2.7/_yaml.so
ld: file not found: python.exe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
I have no idea where it comes from... Any clue?
More precisely, it installs packages into an existing Python installation, for example in /usr/lib/python3/dist-packages/ . If pip is run inside a pyenv environment, it will install the packages into the currently enabled Python environment, somewhere under $PYENV_ROOT .
I ran into the same issue using pyenv. The dirty way I got it to install was using
CC=/path/to/virtualenv_dir/bin/python2.7 /path/to/virtualenv_dir/bin/pip install pyyaml
If you're using pyenv you can also use
CC=$(which python) pip install pyyaml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With