Install pip on a fresh compiled python [duplicate] - python

This question already has answers here:
How to install pip with Python 3?
(23 answers)
Closed 5 years ago.
I have just downloaded the python 3.4 source from the web site and compiled it with ./configure and make. I get a fully functional python.
Everyone says that pip comes embedded with python but that is not true if I compile it from source.
On a console I do:
./python -m pip install numpy
from the compilation folder, and I get:
No module named pip
I am on a RHEL7 system and I want to produce a standalone python folder with all the needed modules. My intention is to ship this python folder along with some python software so that I am sure that everything is ok. (Not to rely on others installing all the packages that are needed on a fresh RHEL7 installation)

Instead of pip try pip3. It is python version 3.x and appropriate one for it is pip3 I guess.

Related

Pip installs packages into the python 3.9 folder, but the executable commands are in the python 3.8 [duplicate]

This question already has answers here:
Dealing with multiple Python versions and PIP?
(28 answers)
Closed 1 year ago.
I have both python 3.8 and 3.9 on my Mac. when I install a new package by pip3 install ..., the package will go to the python 3.9 folder, but apparently the executable commands to run in terminal is in python 3.8 folder, so even though I installed a package, I cannot run the command lines come with it.
I guess I have to somehow point the path of python to version 3.9?
Can somebody help me to fix this?
Try which python3.9 to definitively determine if and where Python 3.9 lives on your path. Then run python3.9 -m pip install … to ensure that the command gets executed against the Python 3.9 interpreter.

pip is not working in the vs code i tried changing the environment variables.. i'm stuck with this [duplicate]

This question already has answers here:
'pip' is not recognized as an internal or external command
(40 answers)
Closed 1 year ago.
pip not working with any followed commands:
pip is not showing anywhere:
It sounds like you may not have pip installed, judging from your pictures. If so type this to check python -m pip --version.
If you don't have it installed, perhaps try python -m pip install.
If you do have pip installed and are trying to install pygame, I suggest trying python -m pip install pygame.
I also found that using python didn't work but replacing it with py did. I did these things (a while ago) in terminal on a windows 10 machine, so my suggestions may not be relevant.

Changing pip directory after Python3.7 update [duplicate]

This question already has answers here:
How to run pip from different versions of python using the python command?
(4 answers)
Closed 4 years ago.
I have installed Python 3.7 I can use Python 3.7 by typing python3 command in terminal.
However if i type pip --version or pip3 --version it prints pip 18.1 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5) in either case. So i cannot install packages to use with Python3.7
How can i set pip3 path and Python version to use it with Python3.7 ?
BTW i use Raspbian Stretch as OS.
Your path is probably not properly configured.
In general, it's best to leave system Python version untouched to avoid breaking things.
I would recommend using pyenv to manage and easily switch Python versions. It can easily work with virtual environments as well, or even as a substitute.
Install from here: https://github.com/pyenv/pyenv#installation

Install a python package in a virtual environment directly from git [duplicate]

This question already has answers here:
pip install from git repo branch
(8 answers)
Closed 5 years ago.
I have a python package I want to use, but it appears that the version installed through pip is seriously outdated, to the point where example code doesn't work. some research independently verified that in order to get the code to work properly, I need the latest version from git.
How do I install a python package from within a virtual environment directly from git without going through pip?
Alternatively, since I don't know too much about pip, if this should never be necessary, then how do I force pip to install the latest version on github?
You'll want to reference this documentation.
Here's the basic format:
pip install -e vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir
In the case of git it'd be something like
pip install -e git+https://www.github.com/name_your_project/name_your_repo

Why does a virtualenv environment contain argparse, distribute and wsgiref? [duplicate]

This question already has answers here:
Why does pip freeze report some packages in a fresh virtualenv created with --no-site-packages?
(2 answers)
Closed 9 years ago.
I am using virtualenv version 1.7.1.2 with python 2.7.3 to create virtual python ennvironments. But when I create such an environment and activate it, I can see the following packages are installed (using pip freeze):
argparse==1.2.1
distribute==0.6.24
wsgiref==0.1.2
Why is that? What does that mean?
These are the standard packages, and will always follow with that version of Python and Virtualenv.
distribute is pretty self-explainatory. It's necessary for pip. Distribute also contains setuptools, but inside the package so not recognized with pip freeze. For more information about what it actually does check out your env/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg.
wsgiref is actually a part of the standard library, but isn't recognized as so. There's a bug report on it, and it's fixed in Python 3.3+. Read more about it in Why does pip freeze report some packages in a fresh virtualenv created with --no-site-packages?
I can't find out why argparse is there though, but my guess is because it's a dependency or something like wsgiref. Finding package dependencies in Python can be a bit hacky/painful though, especially if it's already installed in your virtualenv.

Categories