I'm able to install it with root user but I wanted to install it in a clean environment. My use case is to test the installation of another application with pip for the customer who is using python3.7.0
sudo apt-get update
sudo apt-get install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev
sudo apt-get install python3-pip python3-dev
sudo apt-get install python3.7
Thanks.
(assuming python3.7
is installed)
Install virtualenv
package:
pip3.7 install virtualenv
Create new environment:
python3.7 -m virtualenv MyEnv
Activate environment:
source MyEnv/bin/activate
Some added information, if you are trying for some version like python 3.7.10, which might give following error upon executing pip3.7.10 install virtualenv
.pyenv/versions/3.7.10/bin/python: No module named virtualenv
So, in a general sense you can do the following steps: [commands are specific to MacOs, I am currently using with the new M1 chip]
brew update
brew install pyenv
set environment variables
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
look at the pyenv list to see if the version you install is there or not and install and make it global
pyenv install --list
pyenv install 3.7.10
pyenv global 3.7.10
python -m venv MyEnv
source MyEnv/bin/activate
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