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:
[email protected]:~/HelloWorld$ virtualenv helloworldUsing base prefix '/home/vivian/anaconda3'
New python executable in /home/vivian/HelloWorld/helloworld/bin/python
Installing setuptools, pip, wheel...done.
[email protected]:~/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
Read More:
- Python: What’s Virtualenv
- Configuration (9) to solve the problem of “setup tools PIP wheel failed with error code 1”, create virtual environments with Python of anaconda
- Error: /usr/bin/python: Error while finding module specification for ‘virtualenvwrapper.hook_loader’
- Fatal error in launcher:
- Anaconda builds a new environment and installs sklearn, numpy and other modules
- CONDA creating virtual environment and common CONDA commands
- PIP report failed to create process
- Pychar configures Anaconda environment
- Using CONDA virtual environment in pychar
- Ngnix+gunicorn+Flag project deployment in Ubuntu
- RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
- Command not found: ADB appears on Mac
- In Python, import XXX does not report an error, but in IPython (Jupiter notebook)
- Installing gensim in Anaconda
- When VS code imported Cv2, an error ImportError: numpy.core.multiarray failed to import; There are no mistakes in using the Spyder
- CMD input Java error could not create the Java virtual machine
- “Failed to create interpreter” appears when pychar creates a new project
- Installation of Python on MAC
- Qttssessionbegin failed, error code: 25000 solution for Ubuntu development of iFLYTEK voice wake-up function
- Data analysis to obtain Yahoo stock data: some problems are encountered when using panda datareader (cannot import name ‘is_ list_ Like ‘problem)