I have python virtualenv and trying to install nodeenv it throws
"no python virtualenv is available"
inside my activated python virtual env with . bin/activate
I run the following commands
pip install nodeenv
nodeenv -p
And it throws the error... I'm currently trying to install less with django-compressor
This also happened to me, it's because nodeenv is not installed in your virtual environment. The following solved it for me:
sudo pip uninstall nodeenv
# Source your virtual environment.
source /path/to/virtualenv
pip install nodeenv
nodeenv -p
This happened to me on Mac OSX Yosemite.
I had installed nodeenv as a user. The solution was to install it as root:
pip uninstall nodeenv
sudo pip install nodeenv
# Source the virtual environment or use workon for virtualenvwrapper
workon <virtualenv name>
nodeenv -p
Related
I was creating a new virtual environment on Ubuntu 20.04:
$ virtualenv my_env
But it gave an error:
ModuleNotFoundError: No module named 'virtualenv.seed.embed.via_app_data'
Other info:
$ virtualenv --version
virtualenv 20.0.17 from /usr/lib/python3/dist-packages/virtualenv/__init__.py
#yushulx
I also ran into the same issue. I installed both via pip3 and via sudo apt install python3-virtualenv and it gave me an error but after I ran pip3 uninstall virtualenv I could create a virtualenv without issue
Try to create the virtual environment using directly venv module
python3 -m venv my_env
To fix this on Ubuntu 20.04, I had to uninstall virtualenv from the system: apt remove python3-virtualenv, and reinstall it using pip: pip install --user virtualenv --force-reinstall. I had errors about dependencies conflicts, I fixed them by calling pip install --user ${package} --force-reinstall for every package involved.
virtualenv is installed by default with python itself and when you install virtualenv via pip3 and try to create virtual environment using pipenv you will get this error:
ModuleNotFoundError: No module named 'virtualenv.seed.embed.via_app_data
check the version of installed virtualenv using apt list --installed
mine is:
python3-virtualenv/focal,focal,now 20.0.17-1 all [installed,automatic]
with the installed virtualenv by pip3
min is :
virtualenv 20.4.0
default installation of virtualenv is different with pip3 installed virtualenv
so when you try to create a virtual environment using pipenv for example installing django in a directory home/user/djano with pipenv install django~=3.1.5 you will get that error
the solution is remove installed virtualenv using pip3 uninstall virtualenv and use the default installation of virtualenv this time when you create virtual environment with pipenv it will create it successfully.
I want to have virtualenvwrapper. On Debian 10 testing I did:
apt remove python3-virtualenvwrapper # not purge, I want no changes in ~/.virtualenvs/
apt purge python3-virtualenv
/usr/bin/python3.8 -m pip install --force-reinstall virtualenvwrapper
/usr/bin/python3.8 -m pip install --force-reinstall virtualenv==20.0.23
.24 no longer works. I hope it will be solved sometimes...
EDIT 2021.01: I have changed my stack to: pyenv + pyenv-virtualenvwrapper + poetry. Ie. I use no apt or pip installation of virtualenv or virtualenvwrapper, and instead I install pyenv's plugin pyenv-virtualenvwrapper. This is easier way.
If someone encounters this problem inside existing env (when for example using pyenv) you can also use command below (found on GitHub when tried to fix poetry virtual env installation):
pip install --force-reinstall virtualenv
When I installed virtualenv via pip3, it failed to run virtualenv command. Then I changed the installation via:
sudo apt install python3-virtualenv
The virtualenv command can normally work.
I too had this issue. What I found is it is a permissions issue. For some unknown reason ownership of my home directory was off. I did a chown -R for the directory I was using for my project making myself the owner of my own directory and now everything works as normal.
I also had same issue, seems installed version has different user level so I followed their doc and below one work for me:
python3 -m virtualenv --help
To create new environment:
python3 -m virtualenv my_env
I also faced the same issue but after removing virtualenv which was installed with pip3, I could get rid of this error. Uninstall virtualenv with below command (don't forget to use sudo)
sudo pip3 uninstall virtualenv
After this, virtualenv command works totally fine.
It means that there are two virtualenv in your system.
One is "pip install" by sudo or root, the other may be installed by apt(if you are using ubuntu os)
Just uninstall one of them and the error should be fixed.
I fixed this error by removing all virtualenv and virtualenvwrapper related packages on system and reinstall the virtualenv and virtualenvwrapper with pip with below command(as i use ubuntu, so below only show apt)
remove all packages shown in below result
apt list --installed | grep virtualenvwrapper
apt list --installed | grep virtualenvwrapper
install virtualenv virtualenvwrapper with pip
pip install virtualenvwrapper virtualenvwrapper
set ~/.zshrc
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/amd
export VIRTUALENVWRAPPER_SCRIPT=/home/robot/.local/bin/virtualenvwrapper.sh
export VIRTUALENVWRAPPER_PYTHON=$(which python3)
source /home/robot/.local/bin/virtualenvwrapper.sh
When we use pip3 or python3 to install virtualenv then I got that error too. I had to run each time to create virtualenv (my_env is virtual environment name)
python3 -m virtualenv my_env
But if I install it using
sudo apt install virtualenv
Then virtualenv command works fine.
virtualenv my_env
I want to create a venv having python3.8 as python3
On Ubuntu 18.04
I did:
> sudo apt install python3.8 python3.8-venv
Now, when I try:
> python3.8 -m venv env
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt-get install python3-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
Failing command: ['/home/pushp/vizio-backend/env/bin/python3.8', '-Im', 'ensurepip', '--upgrade', '--default-pip']
My application depends on python3.8. What am I missing here?
Resolved, what I did? :
apt install python3.8 python3.8-venv python3-venv
Dont know how but installing both the venv packages python3.8-venv python3-venv resolved it from me. Now when I do:
python3.8 -m venv env
source env/bin/activate
python3 --version
> Python 3.8.0
first:
sudo pip3 install virtualenv
then cd to the directory where you want your virtual environment to be:
virtualenv "name of env" for ex: sudo virtualenv myProject-env
then to activate:
sudo source myProject-env/bin/activate
to make sure that it is work:
sudo which python
Installing python3-distutils also works around the problem.
You might miss the virtual environment installation in your machine.
You can install virtualenv using the following command,
sudo apt-get install python3.8-venv python3-venv
or
python3 -m pip install virtualenv
Referring this document from digitalOcean i got the same error but here in this linein this image change python3.6 to python3.8 then it will work fine.
change python3.6 -m venv my_env to python3.8 -m venv my_env
I am trying to install Django in my windows 7 machine, as a prerequisite, I am installing virtualenvwrapper:
pip install virtualenvwrapper-win
But it throws the following error:
Error [WinError 87] The parameter is incorrect while executing command
python setup.py egg_info
Could not install packages due to an EnvironmentError: [WinError 87] The paramet
er is incorrect
[NOTE]:
Python version : Python 3.7.0b4
pip version: pip 10.0.1
Try using pyenv:
Step 1:
install virtualenv using pip
pip install virtualenv
Step 2
In a folder, open cmd and run:
python -m venv virtualenvname
eg:
python -m venv india
Step 3: Activate your Virtual environment by:
india\Scripts\activate
Note: S of sripts has to be in caps
Now you must see india before location in your cmd. If yes then your virtual env has been activated.
Something Like this:
(india) D:\dev\python\django\
pip3 -m venv yourprojectname
Are you trying my command. I got the error like you did with this command I got the problem
but, you can apply the following commands
py -m pip install --user virtualenv
py -m virtualenv env
OR
python3 -m pip install --user virtualenv
python3 -m virtualenv env
I've read a lot of blog post about this and I'm still confused as to what is "best" way to set it up. Most of the blog posts I've read are out-dated. I'm new to Linux and have messed up my system twice now and still can't setup the virtual environments properly. According to what I've read, Virtualenv and Virtualenvwrapper combination is the most widely used setup. So, After a fresh Ubuntu 16.04 LTS install, I do the following:
Install Python 3.6 as shown in the following link.
https://tecadmin.net/install-python-3-6-ubuntu-linuxmint/
The current state of the system now is,
$ python3.6 -V
Python 3.6.4
$ pip3.6 -V
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
pip3 (python3.5) and pip(python2.7) do not come pre-installed. To install them , I do:
$ sudo apt-get install python-pip
$ sudo apt-get install python3-pip
$ which pip
/usr/bin/pip
$ which pip3
/usr/bin/pip3
Now, the pip-version installed through apt-get method is old(version 8.1.1). We need to update it to (version 9.0.1). This is where it all goes wrong.
Question 1: How do I update the two different pip versions without breaking anything?
Assume, both pip versions are upgraded to version 9.0.1
Now, I have to install virtualenv and virtualenvwrapper.
Which pip version do I use to install it?
$ pip install --user virtualenv and $ pip install --user virtualenvwrapper
or
$ pip3 install --user virtualenv and $ pip3 install --user virtualenvwrapper
ps: I'm following this link-
http://chrisstrelioff.ws/sandbox/2016/09/21/python_setup_on_ubuntu_16_04.html
With python 3.6 virtual environments come built-in with the venv module:
python3.6 -m venv my-venv
To create a virtual environment for python 3.5:
virtualenv -p python3.5 env
To create a virtual environment for python 2.7:
virtualenv -p python2.7 env
Try using conda to set up virtual environments ?
With conda you can create a virtual environment and keep each of them separate from the root environment.
I'm having trouble installing packages using virtualenv with python. I do the following:
sudo virtualenv venv
cd venv/bin
source activate
pip install nose
I get the following error:
unable to execute /Users/../venv/bin/pip: No such file or directory
What am I doing wrong here?
run:
cd /usr/local/bin
sudo ./pip install virtualenv
which virtualenv
This should point to /usr/local/bin/virtualenv
which pip
This should point to /usr/local/bin/pip
virtualenv /Users/yourname/path/to/env/envname