Getting errors while installing pip package using command prompt - python

I am a beginner for using python (3.7.4 version with pip 19.0.3 ), but I have got an issue with installing pip in python. I tried every way to install pip package after lots of searching on google (I have already set "add python 3.7 to patch", I also checked old stack overflow questions related to this and I tried to install get-pip.py using cmd etc., but I got the same error every time while installing pip using command prompt. ("could not find a version that satisfies the requirement python-docx (from version:) No matching distribution found for python-docx". Another problem is pycharm's site-package folder shows in red color.(pycharm version 9.2.1).also there are no modules in site package and cant be imported any well known modules from it.I am using windows 10 home edition.Does anyone have another way to tackle this?

As you can see on the pypi page:
Programming Languages:
Python
Python :: 2
Python :: 2.6
Python :: 2.7
Python :: 3
Python :: 3.3
Python :: 3.4
And in the python-docx documentation:
Dependencies
Python 2.6, 2.7, 3.3, or 3.4
Your python version (3.7) is not supported by the module you are trying to install.
You should always check these kind of pages for compatibility when you have trouble installing packages

Related

No module named open3d

I am trying to compile a python program (by running "python file.py"), but it gives me the error of "No module named open3d". I have installed open3d on my Mac system using "pip3 install open3d-python". I am also running python 3.10.4 64 bit.
I reinstalled python 3.10 and that comes with pip, so I am pretty sure that when I use pip to install packages they go in the same place. My vscode also doesn't show any errors when I am interpreting using 3.10, unlike 3.9 where there are yellow squiggles below my import line.
I have looked at other posts about a module not found but their fixes don't seem to work for me.
open3d library is currently not available for python version 3.10. I am solve it by installing with python 3.8.
The supported environment for open3d:
Supported Python versions:
3.6
3.7
3.8
3.9
Supported operating systems:
Ubuntu 18.04+
macOS 10.15+
Windows 10 (64-bit)
If you have other Python versions or operating systems, please refer to Build from source and compile Open3D from source.
Why did you install open3d with pip3 install open3d-python?
The official instruction gives pip3 install open3d.
Did you run your python via python in cmd? Maybe trying python3 could help.
pip install open3d work for me.

How do I install python package tobii_research?

I am trying to install tobii_research for a project and I was following the instructions on http://developer.tobiipro.com/python/python-getting-started.html
I already have python 3.7.6 and pip 21.1.2 installed on my Mac.
When I run pip install tobii-research I get:
ERROR: Could not find a version that satisfies the requirement tobii_research (from versions: none)
ERROR: No matching distribution found for tobii-research
Was there something I forgot to install?
I can not for the life of me figure out how to install this manually either.
Help with pip, or installing manually would be greatly appreciated, but you might have to explain it to me like I am stupid.
Thanks in advance.
It appears that you are not running the correct python version for the versions of the package that are available. If you look at the wheel files available on the tobii-research Downloads page, the software is packaged for either python 2.7 or 3.6.
When trying to install this package myself, I get the same error message as you when trying to install it for python 3.8, but the package installs successfully with my python 2.7 installation.
I would recommend installing a compatible version of python and then running pip through that version using the following command:
[specific_python_installation] -m pip install tobii-research
Try doing it with pip again, but replace the underscore with a hyphen as shown below:
pip install tobii-research
I saw on the PyPi website that they only have it for Python 3.8, so I downloaded that Python version from their official website and installed it (do not add it to path).
Then, I created a virtual environment selecting 3.8 as the Python version (refer to this answer) and activated that virtual environment.
Finally, I run pip install tobii_research and it worked.
One thing that helped me - required Python version. For example, for the version 1.10.2 (which is current at the moment of writing this) only Python 3.10 is supported. Check the list of files distributed within this version.
I was able to install the package on Windows with Python 3.10 but on MacOS I had the same problem and wasn't able to resolve this - I assume it's a problem with the architecture, as there is no version for arm64 if you have a Mac with M1 processor.

Can't install lxml with 32-bit python 2.7, on CentOS

I'm developing with Python on CentOS. Needed Python 2.7 for a certain project. Didn't want to mess with the existing Python 2.6 (64-bit) installation, so installed Python 2.7 (32-bit). Haven't had a problem up until now.
Now I need a new library: lxml. It's actually already installed in the default 2.6 installation, but I need it for Python 2.7. None of the existing installation instruction seem to work. Specifically, I can't use a package manager (for CentOS it's yum), because it is only updating things for the default 2.6 installation. And again, everything from yum is already complete because Python 2.6 already has lxml installed.
If I type in "pip install lxml" I get a ton of error messages but finally it says, "Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?"
Okay, fine. So if I type in "STATIC_DEPS=true pip install lxml", it just times out and fails to download the prerequisites.
Any solution, especially sticking just to pip?

How to downgrade to Python 3.4 from 3.5

I want to install kivy (link here) to use for a project, however, when trying to use pip to install the packages it is dependent upon, I get the following error:
Could not find a version that satisfies the requirement kivy.deps.sdl2 (from versions: )
No matching distribution found for kivy.deps.sdl2
Further reading on kivy's website revealed that these libraries do not support Python 3.5 on windows 10 because of some kind of graphical bug. The website says you need python 3.4 in order to be able to install it.
Which brings the question: How do I install python 3.4 when I already have python 3.5?
If you have an Anaconda installation you can just type:
conda install python=3.4
And it installs 3.4, to re-install 3.5, it's
conda install python=3.5
It works in under a minute.
Uninstall Python 3.5 by going to control panel, uninstall a program, and then look for Python 3.5, click on it and press uninstall. After that download Python 3.4. I don't know any other ways but I think that should work.
I was able to install Python 3.4 in a separate directory and then just change the default interpreter in PyCharm to use the new directory containing 3.4 instead.

Module working in Python 2.7 but getting ImportError in 3.4

I'm trying to run some modules in Python 3.4 that work fine for me in 2.7. tweepy and pexpect are two examples. Unfortunately, in 3.4 on the same Mac, I'm getting "ImportError: No module named 'pexpect'"
Looking at pypi.python.org, I see that tweepy lists Python 3 and Python 3.4 while pexpect lists only Python 3.
To rectify my problem, I've tried upgrading and sudo installing the modules through both pip and pip3.
I'm running Mac OSX El Capitan. I installed 3.4 via the download and instructions at python.org and not through homebrew, et al. pip --version returns: "pip 7.1.2 from /Library/Python/2.7/site-packages (python 2.7)"
I've seen similar questions on StackOverflow, but answers seem to be Linux specific (Importing modules that work in Python 2.7 but not Python 3.4 and How to use pip with Python 3.x alongside Python 2.x) or the answers are not working for me.
Can someone provide me with some insight into what I'm missing?
The Python 3 documentation on Installing Python Modules says that you must install pip for your version and call it per version. As it should be included in Python 3.4 (but unsure what vendor package managers do ...), the following is cited in referenced doc:
python3 -m pip install SomePackage # default Python 3
python3.4 -m pip install SomePackage # specifically Python 3.4
Python3 and Python2 have very separate package definitions. When you have a package installed for python2, it is definitely not installed for python3. Typically, python has a version of pip installed for each version of python. Such as pip3.3 or pip3.4 for python3 and pip 2.6 or pip 2.7 for python 2. If you're trying to use a package for python 2 it will not register as installed for python 3.

Categories

Resources