Pip install results in error "no such option: -E" - python

I just cleaned up my mac after a mavericks install (yeah, i'm late to the party).
I'm using homebrew Python but I've confirmed this error with the stock apple python as well. I've got pip 1.5.6 installed system-wide and also in my virtualenv.
I can pip-sys install for system-wide pip installs no problem. When In a virtualenv though, I get the following error, even with which pip.
pip install -U -r requirements/dev.pip
Usage:
pip <command> [options]
no such option: -E

Seems there is something wrong with the pip install within the virtualenv. Pip is not working but pip2 install works fine. So maybe there's a version conflict where pip installs thinking it's a different python version from what was installed.
To recap
pip install south
fails with above error
pip2 install south
works fine.

Related

Are pip and python consistent? Seems like the answer is no. Can someone help me decrypt the documentation?

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

pip package installs okay but cannot be run

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

pip freeze gives different version from pip --version

I am on Windows 10 and just installed Python 3.7.4. I installed virtualenv using pip install virtualenv, and i got the message that i installed 16.7.2 while 19.2.1 is available. I then used python -m pip install --upgrade pip to upgrade.
Here is the issue: when i type pip freeze on Powershell, i am getting this:
virtualenv==16.7.2
but when i type pip --version, i am getting this:
pip 19.2.1 from c:\users\user1\python\lib\site-packages\pip (python 3.7)
Can you please let me know why pip freeze still shows the old version?
Thanks.
pip and virtualenv are 2 different cases where pip is mainly used for installing python packages and virtualenv for utilizing virtual environments while development.
The following command updates only pip not virtual env
python -m pip install --upgrade pip
If you think you still need to upgrade virtualenv (of course if a new version is available). Please follow the following syntax without specifying a version.
pip install [package] --upgrade

pip is a package and cannot be directly executed

Im trying to install google assistant on my Raspberry Pi, but when I keep getting an error: pip is a package and cannot be directly executed
Instead of
pip [...]
Try doing
python -m pip [...]
Can't really help more without more info.
I think your version of pip is old. You need to upgrade it first, like this:
pip install -U pip
You may need to upgrade setuptools too:
pip install -U setuptools
Since google-assistant-library is available as a wheel, you need to install wheel too:
pip install wheel
I don't know if you can do that with Raspberry Pi, but I recommend you to used a virtualenv. That way, you have a fresh and isolated Python executable and a recent version of pip.
virtualenv your_proj
source your_proj/bin/activate
pip install wheel
pip install google-assistant-library
For newer version ie. using pip3:
pip3 install -U <<package name>>
I had the same problem.
I think it was an outcome of a failed
> .\python.exe -m pip install --upgrade pip
do to some environment misconfiguration.
So it first removed the existing version 10.0.1, and then the installation of the new version 22.3.1 failed, leaving me with no pip.
From official documentation, I ran
> .\python.exe -m ensurepip --upgrade
which restored the original pip 10.0.1.
Then I fixed the environment problem, and then again
> .\python.exe -m pip install --upgrade pip
I now have pip 22.3.1.

Installing pip in Pycharm 2016.3

I upgraded to the new version of Pycharm. In the terminal, it says bash-3.2$ instead of my username. When I tried to install a library, it said that pip command is not found:
bash: pip: command not found
So I installed pip:
bash-3.2$ sudo easy_install pip
Searching for pip
Best match: pip 8.1.2
pip 8.1.2 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip3.5 script to /usr/local/bin
Installing pip3 script to /usr/local/bin
Using /Library/Python/2.7/site-packages
Processing dependencies for pip
Finished processing dependencies for pip</i>
Okay, now all I have to do is use pip to install a library, right?
But then, this happens:
bash-3.2$ pip install pandas
bash: pip: command not found
I don't understand what I have to do to actually install pip. Or should I use sudo easy_install [library]?
I know that this is not precisely what you're asking, but PyCharm has its own built-in package manager. You should not have to use pip manually.
File->Settings->Project Interpreter
https://www.jetbrains.com/help/pycharm/2016.3/installing-uninstalling-and-upgrading-packages.html
there you can manage the installed packages for the selected Python interpreter or virtualenv.
Run this command on your terminal. pip will be installed without any issue.
sudo [your package manager] install python-pip python-dev build-essential
If it is not solved. The problem might be PATH problem.
Type echo $PATH on terminal. There should be /usr/local/bin in the output. If it is not type PATH=$PATH:/usr/local/bin to add /usr/local/bin to PATH

Categories

Resources