using pip3 with 3.7? - pip

this should be dead simple but ive googled for ages and can't find anything on this. maybe too generic of a search.
I have several vms. centos and ubuntu.
they both always come with python3.6 which has always been fine with me. but i gotta do some devwork on an app written in 3.7. So i installed that in ubuntu using the apt-get install python3.7 which went fine but it seems the modules I install with pip3 work on in python3.6...
pip3 install future
import future
works in 3.6 but not 3.7.
What I do?
-thx

which pip3 points to /usr/bin/pip3 hence pip3 install only installs it for python3.6.
For python3.7 you can use /path/to/python3.7 -m pip install future to install it.

Related

I found the way to install PyBluez on Ubuntu 22.04

After many attempts figuring out how to install PyBluez on Ubuntu using pip3 I've seen many people with the same problem. fortunatelly I found the way to do it without pip3:
downloaded the program from https://pybluez.readthedocs.io/en/latest/
then I installed this library using "sudo apt-get install libbluetooth-dev"
and finally installed PyBluez by running "pyhton3 setup.py install" in the folder that I previously downloaded.
My question is why I cant use pip3 to install PyBluez?
I tried sudo pip3 install PyBluez :( :(

How would you install python modules/packages so that my script can be run with pypy3 instead of Python3? ImportError: No module named

I have Python3.8 built from source on my Debian 10 Xfce desktop (binaries are not available in Debian repositories). That said, whenever I can, I run my python scripts with pypy3, which I do for the sake of performance.
Now, when I run the following code with pypy3 :
#!/usr/bin/env python3.8
import requests
from bs4 import BeautifulSoup
url = input("What is the address of the web page in question?")
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
print(soup.title.string)
I get from pypy3:
ImportError: No module named 'requests'
The same script is run by Python3.8 without any problems
I assume that I would have to install the module in a similar way that I did it for Python, that is: sudo pip3.8 install requests.
Based on my research of a similar problem described on Stackoveflow I tried:
pypy3 -m pip3.8 install requests
and got the following from my pypy3:
Error while finding module specification for 'pip3.8' (ImportError: No >module named 'pip3')
Then I also tried to run:
pypy3 -m pip install requests
And got the following:
No module named pip
My pip3.8 works fine for Python3.8, not for my pypy3, though.
How should I look for modules in pypy3. And how should I install them?
Is the problem with installing and importing modules one of the reasons reason for the low usage of pypy3?
Run this once to install pip itself: pypy3 -m ensurepip
The next version of PyPy will improve the error message to describe this command explicitly when you do pypy3 -m pip and pip is not installed yet.
pypy3
Enable snaps on Debian and install pypy3
Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.
Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions.
Enable snapd:
sudo apt update
sudo apt install snapd
Install pypy3:
sudo snap install pypy3 --classic
Normally, the pip and package are installed as follows
First of all, you need to install the pip
Install pip for Python 3
Follow the steps below to install Pip for Python 3 on Debian:
First, update the package list with:
sudo apt update
Next, install pip for Python 3 and all of its dependencies by typing:
sudo apt install python3-pip
Verify the installation by printing the pip version:
pip3 --version
The version number may be different, but it will look something like the one below:
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.5)
Pip Usage
With pip, we can install packages from PyPI, version control, local projects, and from distribution files but in most cases, you will install packages from PyPI.
we want to install a package named croniter, we can do that by issuing the following command:
pip install requests
To uninstall a package run:
pip uninstall requests

How to uninstall Airflow?

I am a newbie to Airflow. i have some trouble to remove Airflow v1.10.3 ,i am using pip3 version 8.1.1 on Ubuntu 16.04.
I already tried to remove pip with sudo apt-get remove python3-pip
and sudo apt-get remove pip3 and all his dependencies.
and tried to remove all libraries related with Python.
But i stil have Airflow and his commands down in terminal.
If you are not able to uninstall with
pip uninstall airflow
Maybe the reason is for the latest versions of Airflow this command will work
pip uninstall apache-airflow
Credits to This Answer.
The command apt-get remove pip doesn't remove pip-installed libraries.To uninstall pip-installed libraries you need to install pip back and then uninstall the libraries using pip:
sudo apt install pip # or pip3
pip uninstall airflow
or
pip3 uninstall airflow
depending on what python version you use.

pip doesn't perform to install a module in Python 2.7, Windows 7

For Windows 7, x64, I'm trying to configure some libraries in Python. I use Python 2.7.11 and the Visual C++ Compiler Package for Python 2.7. When I try to install the library 'numpy-1.10.4+mkl-cp27-none-win_amd64.whl' using pip or easy_install, like:
C:\Python27\Scripts pip install D:\Downloads\numpy-1.10.4+mkl-cp27-none-win_amd64.whl
Nothing happens! I only see blank and can't do anything against it. After searching many pages about similar issues, I followed the instructions from this page:
http://arunrocks.com/guide-to-install-python-or-pip-on-windows/
Thus after installing pip and easy_install in the same path as Python and checking my environment variable the problem still persists..
Do anybody know what else I can do to use pip, or to install the wanted libraries? I'm really thankful for any idea!
You need to use the --use-wheel flag, and also have installed wheel. For example:
pip install wheel
pip install --use-wheel yourfile.whl
Your Windows Account doesnt have full persmissions. Maybe it says its Administrator, but something (ex Server) blocks some operations. I had the same issue at work, I couldnt install PIP but also XAMPP server on my PC.
However, I solved 1st issue - simply ran CMD as Admin, then went to
C:\Python27 and typed:
python.exe -m pip install MySQLdb
so PIP worked, and finally I updated it:
pip install --upgrade pip
P.S: I had 2 pythons 2.7 and 3.5 but did not reinstall or delete anything.

Distribute and Pip for use with Python 3.2

When installing modules with pip or distributes easy_install for python3, modules will instead install for python 2.7 or earlier. Im fairly new to both the mac operating system and python itself (4 months or so). I'd like to get distribute and pip installed and working for python 3.2.
When using easy_install or pip, things will work normally with installing for python 2.7. This is not what I wanted however and I tried to fix this by installing both pip and easy install with:
sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python3
as opposed to
sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
This should accomplish what i wanted to do, however, after installing like that I get:
new-host-6:~ Eric$ pip install spynner
-bash: pip: command not found
If anyone has any experience with the above stated in getting pip and distributes easy_install to work for python3, help would be much appreciated.

Resources