how do I install metapy for a specific version of python - python

I have Anaconda and Python 2.7 install on my PC. "metapy" is install and works just fine with Anaconda in eclipse. But when i try to run any .py file that contains "import metapy" from windows command line i get this error because i have python 2.7 in windows path:
ImportError: No module named metapy
I do not want to change or add Anaconda to windows path.
I tried to install metapy using pip install metay but i get this message
Requirement already satisfied: metapy in c:\anaconda3\lib\site-packages
Is there any way I can install metapy for the python 2.7?

Related

Why do I get "ModuleNotFoundError: No module named 'pyperclip'" despite installing it with pip?

I get a "module not found" error when using idle while trying to import pyperclip.
In command terminal as administrator tried to install pyperclip using:
pip install pyperclip
Output was:
Requirement already satisfied: pyperclip in c:\users\ john smith\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (1.8.2)
I previously had anaconda navigator and jupyter notebook. I could import pyperclip in jupyter notebook. I deleted anaconda to try and see if it was because I had pyperclip installed in only location, but it did not solve the problem.
So where can I go from here?
edit :
I uninstalled python 3.7, as i had both 3.7 32 bit and 3.9 64 bit installed,
i ran the command : pip install pyperclip again in command
output :
Requirement already satisfied: pyperclip in c:\users\ john smith\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (1.8.2)
module still not found
edit: problem solved
went into the script for 3.9 and opened a cmd terminal
installed pip from there
thank you for your responses
It's possible that you're running two version of Python on your machine. Ex. a 2.7 and a 3.10. If you're on Windows, you can run the command py -0p to list all your python versions and their paths.
If you're looking to install pyperclip for a 3+ version of Python, you might want to use pip3 to install it.

no module name pmadarima

On installing pip install pmdarima via command prompt as admin, I get the below message as successful installation.
Requirement already satisfied: patsy>=0.5 in c:\users\username\appdata\local\programs\python\python39\lib\site-packages (from statsmodels!=0.12.0,>=0.11->pmdarima) (0.5.1)
But unable to work on it via Jupyter, get the below error on running
import pmdarima as pm
from pmdarima.model_selection import train_test_split
ModuleNotFoundError: No module named 'pmdarima'
When you do pip install, you're using your system's default python. You can have multiple versions of Python installed on the same computer.
For example, on my Mac if I do python in the terminal that opens Python 2. If I do python3 in the terminal, that opens Python 3.
When I do pip install numpy, it will install it to Python 2 by default. A program running in Python 3 will not be able to find that package.
To get it working for Python 3, I would do python3 -m pip install numpy. This uses the pip belonging to the right Python interpreter.
What is most likely happening here is that your Jupyter notebook is using a different Python interpreter. Try doing the install inside the notebook itself in a cell and that should work.

Unable to install Pyhook Python 3.8.1

I'm trying to install Pyhook on Python 3.8.1via pip install Pyhook but I keep receiving this error message:
ERROR: Could not find a version that satisfies the requirement pyhook (from versions: none)
ERROR: No matching distribution found for pyhook.
I also tried to download it from source and then to install it manually.
pip install C:\Users\Andrea\Downloads\pyHook-1.5.1-cp37-cp37m-win_amd64.whl
ERROR: pyHook-1.5.1-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
Maybe it's not compatible with Python3.8 since the last versione is cp37.
Could I install it in any way? Or I just need to use Python 3.7?
You can try doing the below steps:
Download the py hook module that matches your version of python from here. Make sure that if you have python 32 bit you download the 32 bit module (even if you have windows 64x) and vice versa.
Open your command prompt and navigate to the folder where you downloaded the module
Type pip install and then the name of the file.
Ex: pip install pyHook-1.5.1-cp27-none-win32.whl
Reference for the solution here
The file pyHook-1.5.1-cp37-cp37m-win_amd64.whl which you have downloaded is only compatible with cp37, i.e. python 3.7, since you are using 3.8, this will not work.
Checking this site of whl file, there are also none for python 3.7, but there is a fork of pyhook called PyWinHook, for which the fitting whl is available
Note that you can always run in your cmd python -c "import wheel.pep425tags as w; print(w.get_supported())" to find which version of whl files are supported
Just check if python 3.7 is already installed in your system. If yes, then you can use it to install the 3.7 whl using the below command
py -3.7 -m pip install pyHook-1.5.1-cp37-cp37m-win_amd64.whl
you have to then launch the program from 3.7
py -3.7 program.py

how to install python module for specific python version

i have been trying to install module for python-3.6 through pip. i've read these post from stackoverflow and from python website, which seemed promising but they didn't worked for me.
Install a module using pip for specific python version
python website
I've added python3.6 main folder,Scripts and Lib to PATH and i've tried these commands.But somehow they refer to anaconda installations.
C:\Program Files (x86)\Python36-32\Scripts> pip3 install xlrd
C:\Program Files (x86)\Python36-32\Scripts> pip install xlrd
C:\Program Files (x86)\Python36-32\Scripts> pip3.6 install xlrd
C:\Program Files (x86)\Python36-32\Scripts> py -3.6 -m pip install xlrd
C:\Program Files (x86)\Python36-32\Scripts> py -3 -m pip install xlrd
but they give same answer.
Requirement already satisfied: xlrd in c:\programdata\anaconda3\lib\site-packages (1.1.0)
to install package for a specific python installation, you need a package installer shipped with that installation, in your case, pip is installed by an anaconda installation, use pip.exe or easy_install.exe from this python3.6 installation's Scripts directory instead.
First, Uninstall all the versions you have!
then go to the library https://www.python.org/downloads/
Select the required vesrsion MSI file. Run as administrator!
i think as my python was 3.6 also my anaconda distribution, So anaconda was automatically taking over all commands. i installed python 3.7 with anaconda 3.6 and it worked fine as it was mentioned in python website

How do you install PyDDE to Python 3.4 and not Python 2.4

I am currently trying to install the PyDDE package.
Going to the command line and running pip install PyDDE initially didn't work, so I downloaded the zip package from https://github.com/hensing/PyDDE
and then I navigated to the unzipped folder and used the python setup.py command as specified in the installation instruction.
This installed the PyDDE module in python 2.7, and typing import PyDDE yields the module in 2.7. However, it does not install in 3.4.
I found this similar problem on stackoverflow (
Python 3.4 and 2.7: Cannot install numpy package for python 3.4
Installing numpy for Python 2.7 while also having Python 3.4 installed?
which provided solutions like using sudo pip and going to the python 3.4 folder and using easy_install PyDDE
Since it is already installed for python 2.7 when I use:
easy_install PyDDE or
pip install PyDDE
it happily tells me that pydde 0.2.2 is already installed/the active version, however, loading up Python 3.4 and importing PyDDE still doesn't work.
I have also tried python34 install PyDDE but python34 isn't a recognised command.
Any help would be appreciated.
You need to use pip3:
pip3 install PyDDE
pip installs python2 packages and pip3 does your python3 packages.
You need python3 in your pythonpath go to:
My Computer/Properties/Advanced System Settings/Environment Variables
And add C:\Python34\;C:\Python34\Scripts\ to your pythonpath.
Then download get-pip.py and run python34 get-pip.py

Categories