Tag Archives: env

Virtual environment: error: virtualenv is not compatible with this system or executable

I install the python virtual environment

with the following command

pip install --user virtualenv
#不行的话用下一句命令安装virtualenv
#sudo apt-get install python-virtualenv

python virtual environment installation successful, I created a Virtualenv directory in my home directory. I’m going to put all the virtual environments in this directory. Then, go to this directory and I’ll use the following command to create a virtual environment (I’ll call this virtual environment flask-env)

virtualenv helloworld

, however, it reports the following error message

solution:

open. Bashrc

with the following command

sudo gedit ~/.bashrc

add the following information

on the last line of the open file

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/helloworld/anaconda3/lib

note: cannot have Spaces, on either side of the equal sign “=”/home/helloworld/anaconda3/lib this part is the python lib address, to write this part according to your specific situation.

and then rerun

virtualenv helloworld

virtual environment is created successfully, and the activation command is as follows:

vivian@vivian-Super-Server:~/HelloWorld$ virtualenv helloworldUsing base prefix '/home/vivian/anaconda3'
New python executable in /home/vivian/HelloWorld/helloworld/bin/python
Installing setuptools, pip, wheel...done.
vivian@vivian-Super-Server:~/HelloWorld$ source helloworld/bin/activate

close virtual environment

deactivate

note: the path of the virtual environment cannot have Chinese, otherwise this problem will also occur