Skip to content
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

virtualenv is not compatible with this system or executable #1051

Closed
ivf777 opened this issue May 31, 2017 · 15 comments
Closed

virtualenv is not compatible with this system or executable #1051

ivf777 opened this issue May 31, 2017 · 15 comments

Comments

@ivf777
Copy link

ivf777 commented May 31, 2017

I deleted old virtualenv "my3" with command
rmvirtualenv my3

and I created new virtualenv with command
mkvirtualenv my3 -p python3

I have 3 errors:

Running virtualenv with interpreter /home/myname/anaconda3/bin/python3
Using base prefix '/home/myname/anaconda3'
New python executable in /home/myname/.virtualenvs/my3/bin/python3
Also creating executable in /home/myname/.virtualenvs/my3/bin/python
/home/myname/.virtualenvs/my3/bin/python3: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
ERROR: The executable /home/myname/.virtualenvs/my3/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/home/myname/.virtualenvs' (should be '/home/myname/.virtualenvs/my3')
ERROR: virtualenv is not compatible with this system or executable

What can I do to create new virtualenv "my3"?

P.S.
I have Ubuntu 16.04

@gst
Copy link

gst commented Jun 2, 2017

For python3 it s recommended to use venv module. It s builtin in python3.

@altendky
Copy link

Recommended by some. Others like the 2/3 compatibility and separation from core of virtualenv.

But, is this a dup of #1050? Also, isn't conda what anaconda provides as an alternative?

@yazabaza
Copy link

yazabaza commented Sep 1, 2017

I have the same issue on Mac OS 10.12.6 and virtualenv 15.1.0:

RonMacAir-4:~ r$ virtualenv --system-site-packages /Users/r/tf13py27
Using base prefix '/Users/r/anaconda'
New python executable in /Users/r/tf13py27/bin/python
dyld: Library not loaded: @rpath/libpython3.6m.dylib
  Referenced from: /Users/r/tf13py27/bin/python
  Reason: image not found
ERROR: The executable /Users/r/tf13py27/bin/python is not functioning
ERROR: It thinks sys.prefix is '/Users/r' (should be '/Users/r/tf13py27')
ERROR: virtualenv is not compatible with this system or executable

I suspect this is due to the Anaconda installation changing the system python interpreter path to point to the Anaconda python binary, then virtualenv tries to install from there rather than the original system python binary.

@altendky
Copy link

altendky commented Sep 1, 2017

@yazabaza maybe try specifying the python executable you want to use via -p. It looks like it's now using your Anaconda Python instead of whatever you had before based on the base prefix given.

@yazabaza
Copy link

yazabaza commented Sep 1, 2017

Yes, pointing to the original python interpreter fixed it. Thanks!

@wizardboy2010
Copy link

I used this in ubuntu
virtualenv --system-site-packages -p python3 ~/tensorflow

my error is
Running virtualenv with interpreter /home/user/anaconda3/bin/python3
Using base prefix '/home/user/anaconda3'
New python executable in /home/user/tensorflow/bin/python3
Also creating executable in /home/user/tensorflow/bin/python
/home/user/tensorflow/bin/python3: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
ERROR: The executable /home/user/tensorflow/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/home/user' (should be '/home/user/tensorflow')
ERROR: virtualenv is not compatible with this system or executable

How to overcome this

@altendky
Copy link

altendky commented Sep 6, 2017

@wizardboy2010 are you trying to use virtualenv with your anaconda python? If so, I thought conda was meant for envs with anaconda. If not, it's finding your anaconda python and you need to specify your regular system python instead. Anaconda seems to have put itself earlier in the $PATH so python3 points to it.

@everttrollip
Copy link

If you are still struggling, and experiencing this issue:

ERROR: virtualenv is not compatible with this system or executable

Have you tried installing virtualenv with conda and trying again?

conda install virtualenv

@FourSpaces
Copy link

I also encountered this problem, my environment is anaconda python,
Uninstall virtualenv using pip, install virtualenv using conda,
pip uninstall virtualenv
conda install virtualenv
Virtualenv can be used normally

@vesellov
Copy link

vesellov commented May 8, 2018

in my venv/lib/python3.6/site-packages/virtualenv.py after line 1118 i added: prefix = os.path.abspath(prefix) and it started working on my MacOS Sierra

@axiaoxin
Copy link

I ceate virtualenv in a dir which named like test.2018-08-13_20:16:01 will fail, normal dir name is ok.

New python executable in /data/srv/test.2018-08-13_20:16:01/test/bin/python
ImportError: No module named site
ERROR: The executable /data/srv/test.2018-08-13_20:16:01/test/bin/python is not functioning
ERROR: It thinks sys.prefix is u'/data/srv/test.2018-08-13_20:16:01' (should be u'/data/srv/test.2018-08-13_20:16:01/test')
ERROR: virtualenv is not compatible with this system or executable

anthrotype added a commit to anthrotype/fonttools that referenced this issue Sep 12, 2018
formula is now named just 'python'.
For the homebrew version installed on Travis (which we don't
autoupdate) we *should* get python3.6 with this currently.

It might be the case that python3 is already installed on
Travis macOS image, but need to check.

We call tox with 'TOXENV=py3' so that when Travis updates its homebrew,
we'll get python3.7 automatically.

Finally, use virtualenv instead of venv on mac to fix tox bootstrapping issue

pypa/virtualenv#1051
pre-commit/pre-commit#631
https://travis-ci.org/fonttools/fonttools/jobs/427582922#L214

fixup
@stale
Copy link

stale bot commented Jan 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 14, 2019
@jandog8990
Copy link

So I'm having the same problem but I don't think it's an Anaconda thing, I've installed Py3.5 standalone with the latest pip and virtualenv and I get the following errs:

Running virtualenv with interpreter /usr/bin/python
Using base prefix '/System/Library/Frameworks/Python.framework/Versions/3.5'
New python executable in ///PythonInstalls/venv/bin/python
ERROR: The executable ///PythonInstalls/venv/bin/python is not functioning
ERROR: It thinks sys.prefix is '/System/Library/Frameworks/Python.framework/Versions/3.5' (should be '///PythonInstalls/venv')
ERROR: virtualenv is not compatible with this system or executable

Has anyone solved this without the need for Anaconda? That's a whole set of probs I'm not willing to try at the moment

@gaborbernat
Copy link
Contributor

Hmm feels like a problem with the system python of Mac. Can you replicate with the brew one, or the official one with python.org?

@stale stale bot removed the wontfix label Jan 15, 2019
@jandog8990
Copy link

@gaborbernat Hey so I finally got it, instead of using virtualenv executable use the pyvenv for Mac users!

$ pyvenv --system-site-packages ./venv

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests