This question already has answers here:
pip: no module named _internal
(30 answers)
Closed last month.
Today, I installed Pipenv via
pip install pipenv
As mentioned in the documentation I went to a test directory and created a new virtual environment using
pipenv shell
and tried to install a package via
pipenv install numpy
I got the following error message:
Installing numpy…
⠧
Error: An error occurred while installing numpy!
Traceback (most recent call last):
File "/Users/florian/.local/share/virtualenvs/test-bJfQ6Jzk/bin/pip", line 7, in <module>
from pip._internal import main
ModuleNotFoundError: No module named 'pip._internal'
This error occurs even after reinstalling pipenv, deleting all files and recreate the environment. It also had no impact if I ran pipenv install numpy inside or outside the environment.
Python 3.6.3
Pipenv 11.10.1
Thank you in advance.
I have had the same issue (python 3.5/Ubuntu 16.04LTS). Reinstalling pip with:
sudo apt install python-pip python-pip3 --reinstall
didn't solve the issue with me.
What worked in my case was reinstalling pipenv itself, from pip:
sudo pip3 install pipenv --force-reinstall
If you are running python 2.x or if your system is different than mine, you can try to replace pip3 with pip in the command:
sudo pip install pipenv --force-reinstall
Ubuntu 18.04, Python 3.6 :
Reinstalling pipenv did not work for me. Reinstall pip3 was the only issue, but
sudo apt install python3-pip
did not work too. Found a link to get pip3 in AskUbuntu.com which worked fine :
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3 get-pip.py --force-reinstall
After trying around for a while, I fully reinstalled pip. This solved the problem and everything is working now as expected.
Before providing the two commands, which solved the problem, I want to specify some things:
I'm on MacOS
python stands for python3 (added an alias for that, because I only use python3)
pip is on version 9 and NOT 10
Here are both commands:
sudo pip uninstall pip
sudo python get-pip.py
I resolved problem using this command:
pip3 install pipenv --upgrade
The environment pipenv is trying to use may be corrupt for the current project.
Removing it, and re-running pipenv install worked in my case. I am on Fedora 35, where the python virtualenvs are located in ~/.local/share/virtualenvs/, this may be different in your case.
find out which virtualenvs are on your disk:
ls ~/.local/share/virtualenvs/
remove the ones belonging to your project:
rm -rf ~/.local/share/virtualenvs/yourprojectname*
Related
I'm new to macos and trying to get a dev environment going...I need pip but getting an error message with just pip.
Getting error pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application
Python3 was installed with macos and I tried to install 2.x version and made it the global default. I think that's why I'm getting the above error.
I uninstalled the 2.x python using pyenv.
How can I remove pip (i've got pip, pip3 and pip 3.8) and start over.
Thanks.
Can you try removing pip using this in the directory where pip pacakge is installed?
sudo rm -r pip <Version Number>
You can get the directory where pip is installed with this: which pip and then cd into that path and run the above command.
I installed python3.9 in ubuntu and also make it default which creates some problems. So I again make python 3.5 as default and removed python 3.9.
Then I tried to install pip by using command:
sudo apt-get install python3-pip
and it installed successfully but when I ran:
pip3 --version
it gives me this error:
/usr/bin/python3.9: bad interpreter: No such file or directory
I don't know why I removed python 3.9 completely with all its dependencies then why pip is not installing properly?
Please help me out here i'm really stuck.
This answer might help, you can run pip as a module, try python3 -m pip [commands] to see if it works.
Try running:
pip --version
It might work.
So i'm trying to implement stripe on a Django app and i'm having issues.
I installed Stripe using pip3 -install stripe and it downloaded. However when I run the server it says
ModuleNotFoundError: No module named 'stripe'
So looking around and on this I think I found some sort of an answer.
https://nomodulenamed.com/a/I-have-installed-the-package-using-pip#fail-to-install
Are pip and python consistent?
Seems like the answer is no.
pip3 -V returned pip 20.0.2 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
and
python3 -V returned Python 3.8.2
It seems that the easy fix is using python3 -m pip3 -V but that returns No module named pip3
and
python3 -m pip -V returns pip 20.1 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
but pip -V returns zsh: command not found: pip
which leaves me quite confused
more over i'm suppose to do # install your package
python -m pip <your-package-name>
so what goes in the place of
<your-package-name>
and I'm I suppose to use pip of pip3 since I use pip3 to install thing.
Since you can have more than one Python2 installation and more than one Python3 installation available on your machine, your question is better answered by understanding virtual environments.
It is precisely the reason why virtual environments exist!
when you create a python3 virtual environment there is no need to call pip3 as it is the default pip.
start by creating your virtual env (Assuming you have virtualenv installed ... if not install it on linux ubuntu by calling
sudo apt-get install virtualenv
sudo apt-get install python3-pip
python3 -m venv env
source bin/env/activate
pip install <yourpackage>
but I believe you are on macOS since you are getting zsh error,
fix your installation by using homebrew
brew install python3
pip3 install virtualenv
virtualenv -p python3 <path-to your-project>
source <path-to your-project>/bin/activate
I am wanting to install a pip package on Debian but when I install it using
pip install bitmex-market-maker
or
pip install --user bitmex-market-maker
it doesn't work and gives me
-bash: marketmaker: command not found
error here
it works fine on my MacBook
I tried to reinstall reboot and even tried pip3 to no avail.
To run the libraries you first need to be inside the python environment.
At your terminal try:
python -m marketmaker
I am trying to run this tutorial
https://learn.microsoft.com/en-US/azure/data-factory/quickstart-create-data-factory-python
but I fail to install the packages. I tried several installations but I keep getting the error No module named 'azure.mgmt.datafactory' when trying to run from azure.mgmt.datafactory import DataFactoryManagementClient.
I am using anaconda and windows 10.
I tried running the recommended anaconda packages https://anaconda.org/anaconda/azure and https://anaconda.org/clinicalgraphics/azure-mgmt-resource under a python 3.5 environment and I also tried to manually install everything from github (https://github.com/Azure/azure-sdk-for-python) using
git clone git://github.com/Azure/azure-sdk-for-python.git
cd azure-sdk-for-python
python setup.py install
In both the normal (Python 3.6) and the new (Python 3.5, using Anaconda version with Python 3.5) environment. None of this worked.
What am I missing?
(Note that from azure.mgmt.resource import ResourceManagementClient worked fine with the anaconda installation)
EDIT
After the first response, I ran the following commands from the powershell
pip install azure-mgmt-resource
pip install azure-mgmt-datafactory
pip install azure-mgmt
which resulted in ModuleNotFoundError: No module named 'azure.mgmt'
Uninstalling the three packages and installing azure-mgmt as a first one did not solve the issue either. However, I don't know how to uninstall the manually installed package from python setup.py install, which still might be an issue.
Have you tried pip install in powershell/cmd?
pip install azure-mgmt-datafactory
Update (Jan's answer):
pip freeze > requirements.txt
pip uninstall -r requirements.txt
python -m pip install azure-common
python -m pip install azure-mgmt
python -m pip install azure-mgmt-datafactory (this might not be needed as it comes with azure-mgmt)
Ok, this is how I got the required azure libraries to work (thx to Saul Cruy, who gave me the idea)
Using this post What is the easiest way to remove all packages installed by pip?, I created a requirements file in PowerShell
pip freeze > requirements.txt
In this file, I manually kept only the entries with azure.
Then, I deleted all packages in the file
pip uninstall -r requirements.txt
The steps above were repeated twice, as upon first delete, some azure packages survived.
Then, I ran (all in PowerShell, in that order)
python -m pip install azure-common
python -m pip install azure-mgmt
python -m pip install azure-mgmt-datafactory
The reason might(!) be that installing packages in the anaconda console using the conda commands causes confusion in the dependencies (I tried a similar approach in a conda environment as it seemed like a good idea to seperate the azure packages from the other ones, but without success).