pip 2 & 3 Syntax change - python

I use an arch-linux system and just installed pip via yaourt.
yaurt -S pip
Then I tried to install something via pip for python 3. But I get an error like this:
pip install requests
install: missing destination file operand after ‘requests’
Try 'install --help' for more information.
where
pip2 install requests
will just work.
What is the "missing destination file operand"? What am I supposed to pass?

The comments were right to assume that it has to work usually. There must be something wrong with the packed pip package for yaourt. I reinstalled python-pip via pacman and everything just works as intended.

I see this is an old question, but for anyone who got here from a google search like me, the "pip" package in the AUR is not the python package manager! Install the package python-pip instead.

I got this after a typo:
sudo -h pip3.6 install bpython
install: missing destination file operand after 'bpython'
Try 'install --help' for more information.
Fixing the parameter did the trick:
sudo -H pip3.6 install bpython

Related

Need to install Python Pint Package using MSYS

I am very new to using MSYS and I need it to run a Fortran based code through python interface. I followed the whole installation procedure in this link
https://github.com/SINTEF/thermopack/blob/main/addon/pycThermopack/README.md
and when I tried to install Python Pint package I kept getting this error:
MSYS Error
It seems that this package is very important to run the GUI correctly. What did I miss here? Is there any other way to install this package?
Thanks a lot in advance.
Solution
I managed to install it by installing Pip command using
$ pacman -S python3-pip
$ pip3 install --upgrade pip
pip install Pint

How to recover PIP

I think I uninstalled pip by mistake ^^
I ran something like "pip uninstall pip" in CMD and it completely broke, giving fatal errors.
I uninstalled and reinstalled python, added the correct folders back to PATH, but now it's only working via python -m pip XXXX and not by typing pip XXXX...
If I type pip XXX i get an empty row and CMD gives me back the cursor.
How can I recover? I liked pip XXX better and I am sure that the pip folder is in PATH.
It would help greatly to know what version of each you are using and what OS but for a generic answer...
You could try to install it manually:
Vist:
https://pip.pypa.io/en/stable/installing.html
Download:
get-pip.py
python get-pip.py
Make sure your python version matches your pip version. Otherwise you will always have to be specific on your installs. And for sake of simplicity make sure it works fine with just one version of Python installed. Then if that works you can consider having more.
After installing it, if you upgrade your python version make sure you keep it up to date.
I would try something like:
pip install --upgrade --no-deps --force-reinstall
As os version 21.3.1, you can install pip with the one-liner:
python -m ensurepip --upgrade.
See installation of pip doc for details.

pip install in python 3.6.5

I'm trying to install some libraries on python, and I open cmd and type-m pip install <lib_name> but it says there's syntax error. When I skip the "<" it says pip is not a recognized command. Any help? I'm using Python 3.6.5.
enter image description here
this is the output for almost every command I'm trying...
first of all we need to know if you are good to go with pip.
Try posting the output of
pip --version
If pip doesn't seem to be installed, you should install it via
python -m ensurepip --default-pip
Once pip is installed you can install packages using the command
pip install whatever
Here's a complete starter pack tutorial for using pip :)
https://packaging.python.org/tutorials/installing-packages/
you can enter either cmd into the terminal:
python -m pip install <package-name>
or
pip install <package-name>
The first will always install into your global environment and the second could depend on whether you're in a virtualenv (if none of this makes sense to you, don't worry about it).
First install python!
According to your screenshot, it is not installed... (or not available, in that case check your PATH in system properties).

Install Package in Python

I'm trying to install bayespy on enthought canopy and have read through all the documentation and cannot figure it out. I import pip and then run the following code (I have tried many variations on this too) :
pip install <bayespy>
It keeps coming back with an error message. Do I need to specify the file path to bayespy possibly?
Thanks in advance,
Max
Edit :
pip install <bayespy>
File "<ipython-input-2-bb1febf67aaf>", line 1
pip install <bayespy>
^
SyntaxError: invalid syntax
The most basic usage of "pip" is as a command-line tool. Try this from the command prompt (NOT within a Python shell):
pip install bayespy
or perhaps
sudo pip install bayespy
First: BayesPy requires Python 3.
Try This:
yourMachine> sudo pip3 install bayespy
Not this at python prompt: >>> sudo pip3 install bayespy

Installing Python Package from Github Using PIP

I've seen it documented that you can install a Github hosting Python package using pip via:
sudo pip install -e git+git://github.com/myuser/myproject.git#egg=myproject
However, this appears to install the package to the current working directory, which is almost never where is should be.
How do you instruct pip to install it into the standard Python package directory (e.g. on Ubuntu this is /usr/local/lib/python2.6/dist-packages)?
The -e flag tells pip to install it as "editable", i.e. keep the source around. Drop the -e flag and it should do about what you expect.
sudo pip install git+git://github.com/myuser/myproject.git#egg=myproject
If that doesn't work try using https instead of git.
sudo pip install git+https://github.com/myuser/myproject.git#egg=myproject
For Python 3 make sure you have python3-pip installed (and of course git installed):
The syntax just changed to:
sudo pip3 install git+git://github.com/someuser/someproject.git

Categories

Resources