This question already has answers here:
Cannot install pyaudio, gcc error
(16 answers)
Closed 3 years ago.
I have Ubuntu 16.04. My system has 2 versions of Python. One is a 2.7.12(existed by default) and one is a 3.6.5 which I installed. For one of my projects I required the pyaudio module of python for which I typed in the command
sudo apt-get install python-pyaudio python3-pyaudio
It got installed successfully but the problem is that it got installed only on python 2.7.12 and not for python 3.6.5.
What should I do to get it for 3.6.5 as well?
you must Simply Download the module with pip:
pip install pyaudio
then run it on python:
>>> import pyaudio
>>>
Use pip3 it's
pip3 install pyaudio
then run it on python:
>>> import pyaudio
>>>
Related
On my Mac, I have 2 versions of Python running, one from Brew (3.9) and another one (3.8)
When I try to install some data science packages via pip3, they are installed but cannot be used as 3.9 takes over.
python3 --version
Python 3.9.10
which python3
/opt/homebrew/bin/python3
pip3 install pandas
Requirement already satisfied: pandas in /Library/Python/3.8/site-packages
python3
import pandas
ModuleNotFoundError: No module named 'pandas'
pandas is just one example of the many packages I see via pip3 freeze.
What are my options to point to installed versions at Python 3.8 ?
There are different ways to approach this:
One temporary option is to use alias like this:
alias python3=python3.8
You can use directly python3.8 in your terminal.
If you want to install the packages to python3.9 then you can also use pip3.9
You could use:
python3 -m pip install module
which will use pip to install to the python version you just used.
The recommended way is to use:
python3 -m pip install module
This question already has answers here:
How to run pip from different versions of python using the python command?
(4 answers)
Closed 2 years ago.
I want to install a library that only works on python 3.7 but i also have python 3.8. I can do between 2.x and 3.x but not between 3.x verisons. Any help is appriciated thank you!
Found it!
py 3.x -m pip install <MODULE>
works!
pip install SomePackage
Eg.
pip install numpy
pip install flask
This question already has answers here:
How do I install pip on Windows?
(40 answers)
Closed 4 years ago.
On my computer (windows 8.1) there is python 3.4.
When I try to install module with pip install the code that I use is:
py -m pip install ...
But the command line returns the following error:
C:\Python34\python.exe: No module named pip.__main__; 'pip' is a package and cannot be directly exec
uted
Pip is just not a standalone executable. It is a python module.
So as a matter of fact you can do this (Tested with numpy, worked correctly as wanted):
python -m pip install numpy
Well, you should see the documentation on Python.
I did mention that Pip is a standalone executable. If it is in you path then you can also do this:
pip install numpy
Make sure python is in your path.
This question already has answers here:
Error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat) when running Python script [duplicate]
(8 answers)
Closed 4 years ago.
I am trying to install pandas and I keep getting an error
Microsoft visual c++ 10.0 is required?
Is it really necessary to have it ? and how can I have it?
when I try to upgrade pip from 9 to 18, it says I should do it through python, how is that?
Thanks in advance
You should first try to upgrade your pip from version 9 to version 18.
If you have virtual environment. Then first activate your virtualenv or else if you have global python installed. They simply type the following command
pip install --upgrade pip
This will show the following output
(p_env) ➜ python_playground git:(master) ✗ pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 1.4MB/s
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-18.0
Once your pip is upgraded. Then type the following command to install pandas
pip install pandas
I am completely new to programming and Linux OS.
In my Linux machine, I edited my bashrc so that when I type python, it calls python3. I have python 3.4 and python 3.5.2 installed. Recently, I install this module pyperclip using pip3 install.
My problem is when at python 3.5.2, the pyperclip module couldn't be found, I couldn't import it at terminal. When at python 3.4, I get to import the module.
Being completely new to Linux, I have no idea how to access the "pyperclip" module via python 3.5.2
I bought this book "Automate the Boring Stuff with Python." and the projects are really interesting.
Is it advisable to have more than one version of Python in my machine? Can I just use only one? How to I import pyperclip module in python 3.5.2?
Try this in Terminal.
pip3 install
pip3 install setuptools
pip3 install pyperclip
However you may need to have downloaded the zip pyperclip module first. Mine was in my Downloads directory on my Mac before I ran the previous three pip lines in Terminal.