Can't install PyQt5 on python 3 with spyder ide - python

So I'm trying to install the PyQt package so I just did this on my Anaconda Prompt:
C:\Users\USER>pip install PyQt5
Collecting PyQt5
Using cached PyQt5-5.15.0-5.15.0-cp35.cp36.cp37.cp38-none-win_amd64.whl (64.5 MB)
Collecting PyQt5-sip<13,>=12.8
Using cached PyQt5_sip-12.8.0-cp37-cp37m-win_amd64.whl (62 kB)
ERROR: spyder 4.1.4 requires pyqtwebengine<5.13; python_version >= "3", which is not installed.
ERROR: spyder 4.1.4 has requirement pyqt5<5.13; python_version >= "3", but you'll have pyqt5 5.15.0 which is incompatible.
So I tried a different version with:
pip install --upgrade --user pyqt5==5.12
And then this happened:
Collecting pyqt5==5.12
Downloading PyQt5-5.12-5.12.1_a-cp35.cp36.cp37.cp38-none-win_amd64.whl (49.4 MB)
|████████████████████████████████| 49.4 MB 43 kB/s
Collecting PyQt5_sip<4.20,>=4.19.14
Downloading PyQt5_sip-4.19.19-cp37-none-win_amd64.whl (52 kB)
|████████████████████████████████| 52 kB 3.8 MB/s
ERROR: spyder 4.1.4 requires pyqtwebengine<5.13; python_version >= "3", which is not installed.

To install these with our errors try this.
Try installing pyqtwebengine version 5.12 and then install pyqt5 version 5.12. using
following commands:
pip install --upgrade --user pyqtwebengine==5.12
pip install --upgrade --user pyqt5==5.12
By this, I have successfully installed pyqt5

Related

pip uninstalled and now I don't know what to do?

So this is what I've tried to do in Windows 10 cmd
C:\Users\lewis>pip install pandas
Collecting pandas
Downloading pandas-1.4.1-cp310-cp310-win_amd64.whl (10.6 MB)
---------------------------------------- 10.6/10.6 MB 8.2 MB/s eta 0:00:00
Collecting pytz>=2020.1
Downloading pytz-2022.1-py2.py3-none-any.whl (503 kB)
---------------------------------------- 503.5/503.5 KB 8.0 MB/s eta 0:00:00
Collecting numpy>=1.21.0
Downloading numpy-1.22.3-cp310-cp310-win_amd64.whl (14.7 MB)
---------------------------------------- 14.7/14.7 MB 8.5 MB/s eta 0:00:00
Collecting python-dateutil>=2.8.1
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
---------------------------------------- 247.7/247.7 KB 5.1 MB/s eta 0:00:00
Collecting six>=1.5
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: pytz, six, numpy, python-dateutil, pandas
Successfully installed numpy-1.22.3 pandas-1.4.1 python-dateutil-2.8.2 pytz-2022.1 six 1.16.0'
So the module I wanted seems to have succesfully installed before I was prompted with this message.
WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the
'C:\Users\lewis\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.'
So my pip is out of date woop! So I proceed to upgrade the pip.
C:\Users\lewis>pip install --upgrade pip
Requirement already satisfied: pip in
c:\users\lewis\appdata\local\programs\python\python310\lib\site-packages (22.0.3)
Collecting pip
Downloading pip-22.0.4-py3-none-any.whl (2.1 MB)
---------------------------------------- 2.1/2.1 MB 6.4 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.0.3
Uninstalling pip-22.0.3:
Successfully uninstalled pip-22.0.3
Then this is where it all goes wrong.
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied:
'C:\\Users\\lewis\\AppData\\Local\\Temp\\pip-uninstall-un6fh2sa\\pip.exe'
Consider using the `--user` option or check the permissions.
So it doesn't reainstall a new version of pip so I'm left with nothing.
But it does still retrieve a version of pip from a file.
C:\Users\lewis>pip --version
pip 22.0.4 from C:\Users\lewis\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)
What's happened here and how do I fix it. Not really that advanced on pip stuff. Thanks!
Is everything ok, you have numpy and pip installed and if you want to upgrade pip, just use the --user flag as is said in your own post:
pip install --upgrade --user pip

Unable to locate package python-pytest

I had to reset my machine recently, and so have to re-install everything again.
I want to run a Python file using PyTest.
Bash Terminal:
me#PF2DCSXD:/mnt/c/Users/dabell/Documents/GitHub/workers-python/workers/composite_key/compositekey/tests$ pytest -s test_composite_key.py
Command 'pytest' not found, but can be installed with:
sudo apt install python-pytest
me#PF2DCSXD:/mnt/c/Users/dabell/Documents/GitHub/workers-python/workers/composite_key/compositekey/tests$ sudo apt install python-pytest
[sudo] password for danielbellhv:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pytest
I was able to install pip, following this post's Solution.
Please let me know if there is anything else I can add to post.
I had to first install pip, as here:
sudo apt-get update
sudo apt-get upgrade #Optional
sudo apt install python3-pip
Then
$ pip install pytest
Collecting pytest
Downloading pytest-6.2.5-py3-none-any.whl (280 kB)
|████████████████████████████████| 280 kB 621 kB/s
Collecting packaging
Downloading packaging-21.2-py3-none-any.whl (40 kB)
|████████████████████████████████| 40 kB 1.1 MB/s
Collecting iniconfig
Downloading iniconfig-1.1.1-py2.py3-none-any.whl (5.0 kB)
Collecting pluggy<2.0,>=0.12
Downloading pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
Collecting py>=1.8.2
Downloading py-1.10.0-py2.py3-none-any.whl (97 kB)
|████████████████████████████████| 97 kB 1.1 MB/s
Collecting toml
Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: attrs>=19.2.0 in /usr/lib/python3/dist-packages (from pytest) (19.3.0)
Collecting pyparsing<3,>=2.0.2
Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
|████████████████████████████████| 67 kB 1.1 MB/s
Installing collected packages: pyparsing, packaging, iniconfig, pluggy, py, toml, pytest
WARNING: The scripts py.test and pytest are installed in '/home/danielbellhv/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed iniconfig-1.1.1 packaging-21.2 pluggy-1.0.0 py-1.10.0 pyparsing-2.4.7 pytest-6.2.5 toml-0.10.2
Note:
$ pip install python-pytest
ERROR: Could not find a version that satisfies the requirement python-pytest (from versions: none)
ERROR: No matching distribution found for python-pytest

ERROR: Could not find a version that satisfies the requirement vineyard (from versions: none)

I am trying to install the package "grammar" whose dependencies include the packages "vineyard" and "Graphviz". I am using Pycharm, and I was able to install Graphviz without any issues.
However, while installing packages "grammar" and "vineyard", I am getting the below error:
C:\<mylib>>pip install grammar
Collecting grammar
Using cached https://files.pythonhosted.org/packages/7f/a3/4e712822d562faea9ec03f9181e53cf9dec0f4bebb1a19fceec6d3f51089/grammar-1.6-py3-none-any.whl
Collecting vineyard (from grammar)
Could not find a version that satisfies the requirement vineyard (from grammar) (from versions: )
No matching distribution found for vineyard (from grammar)
and
ERROR: Could not find a version that satisfies the requirement vineyard (from versions: none)
When i try and install using the below command:
pip install C:/<mylib>/vineyard_io-0.2.7-py3-none-any.whl
i get the below error:
Processing c:<mylib>\vineyard_io-0.2.7-py3-none-any.whl
Collecting oss2
Downloading oss2-2.15.0.tar.gz (226 kB)
|████████████████████████████████| 226 kB 544 kB/s
Collecting pyorc
Downloading pyorc-0.4.0-cp39-cp39-win_amd64.whl (765 kB)
|████████████████████████████████| 765 kB 273 kB/s
Collecting s3fs
Using cached s3fs-2021.8.0-py3-none-any.whl (26 kB)
Collecting pyarrow
Downloading pyarrow-5.0.0-cp39-cp39-win_amd64.whl (14.5 MB)
|████████████████████████████████| 14.5 MB 159 kB/s
Collecting hdfs3
Downloading hdfs3-0.3.1.tar.gz (44 kB)
|████████████████████████████████| 44 kB 409 kB/s
ERROR: Could not find a version that satisfies the requirement vineyard==0.2.7 (from vineyard-io) (from versions: none)
ERROR: No matching distribution found for vineyard==0.2.7
I am using python version 3.9.
I think you should be using pip3 instead of pip, since your python version is 3.x.
pip3 install C:/<mylib>/vineyard_io-0.2.7-py3-none-any.wh
Please, tell me if this has worked for you. I downloaded your wheel and installed the wheel using the same python version as you, but using pip3 instead of pip.
The issue was resolved after downgrading the python version to 3.8 from 3.9.
I was able to install vineyard and then grammar after that without any issues.
pip install C:/<mylib>/vineyard_io-0.2.7-py3-none-any.whl

Matplotlib still not installing on v3.8.6 of python. (Earlier I was on v3.9)

I was told the wheels for matplotlib are not available for python v3.9 yet so I should try installing v3.8.6. So I uninstalled python and reinstalled it to that version,
But when I ran
sudo easy_install pip
the output was:
Searching for pip
Reading https://pypi.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/cb/28/91f26bd088ce8e22169032100d4260614fc3da435025ff389ef1d396a433/pip-20.2.4-py2.py3-none-any.whl#sha256=51f1c7514530bd5c145d8f13ed936ad6b8bfcb8cf74e10403d0890bc986f0033
Best match: pip 20.2.4
Processing pip-20.2.4-py2.py3-none-any.whl
Installing pip-20.2.4-py2.py3-none-any.whl to /Library/Python/2.7/site-packages
Adding pip 20.2.4 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip3.8 script to /usr/local/bin
Installing pip3 script to /usr/local/bin
Installed /Library/Python/2.7/site-packages/pip-20.2.4-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
so I thought pip was install and then I ran:
python -m pip install -U matplotlib
and got this output:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting matplotlib
Downloading matplotlib-2.2.5-cp27-cp27m-macosx_10_9_x86_64.whl (12.9 MB)
|████████████████████████████████| 12.9 MB 5.2 MB/s
Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (2.0.1)
Collecting backports.functools-lru-cache
Downloading backports.functools_lru_cache-1.6.1-py2.py3-none-any.whl (5.7 kB)
Requirement already satisfied, skipping upgrade: pytz in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (2013.7)
Requirement already satisfied, skipping upgrade: six>=1.10 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (1.12.0)
Collecting python-dateutil>=2.1
Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
|████████████████████████████████| 227 kB 17.3 MB/s
Collecting cycler>=0.10
Downloading cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Requirement already satisfied, skipping upgrade: numpy>=1.7.1 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (1.8.0rc1)
Collecting kiwisolver>=1.0.1
Downloading kiwisolver-1.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (115 kB)
|████████████████████████████████| 115 kB 19.0 MB/s
Collecting subprocess32
Downloading subprocess32-3.5.4-cp27-cp27m-macosx_10_6_intel.whl (34 kB)
Requirement already satisfied, skipping upgrade: setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from kiwisolver>=1.0.1->matplotlib) (41.0.1)
Installing collected packages: backports.functools-lru-cache, python-dateutil, cycler, kiwisolver, subprocess32, matplotlib
Successfully installed backports.functools-lru-cache-1.6.1 cycler-0.10.0 kiwisolver-1.1.0 matplotlib-2.2.5 python-dateutil-2.8.1 subprocess32-3.5.4
so I assumed matplotlib was successfully installed and ran this test code in IDLE:
#Importing pyplot
from matplotlib import pyplot as plt
#Plotting to our canvas
plt.plot([1,2,3],[4,5,1])
#Showing what we plotted
plt.show()
to which again I'm getting the error:
Traceback (most recent call last):
File "/Users/Jai/Desktop/Python Programs/Test 1.py", line 2, in <module>
from matplotlib import pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
can someone please help? I'm on MacOS 10.15.7
Thanks.

Issues importing python-pptx on Linux (Ubuntu 17)

I am trying to import the python pptx library in a python programm. I installed it using pip before, which gave me the following output:
Collecting python-pptx
Downloading python-pptx-0.6.6.tar.gz (8.4MB)
100% |████████████████████████████████| 8.4MB 132kB/s
Collecting Pillow>=2.6.1 (from python-pptx)
Downloading Pillow-4.2.1-cp27-cp27mu-manylinux1_x86_64.whl (5.8MB)
100% |████████████████████████████████| 5.8MB 193kB/s
Collecting XlsxWriter>=0.5.7 (from python-pptx)
Downloading XlsxWriter-0.9.8-py2.py3-none-any.whl (137kB)
100% |████████████████████████████████| 143kB 1.2MB/s
Collecting lxml>=3.1.0 (from python-pptx)
Downloading lxml-3.8.0-cp27-cp27mu-manylinux1_x86_64.whl (6.8MB)
100% |████████████████████████████████| 6.8MB 166kB/s
Collecting olefile (from Pillow>=2.6.1->python-pptx)
Downloading olefile-0.44.zip (74kB)
100% |████████████████████████████████| 81kB 1.3MB/s
Building wheels for collected packages: python-pptx, olefile
Running setup.py bdist_wheel for python-pptx ... done
Stored in directory: /home/clemens/.cache/pip/wheels/27/f8 /dc/181ed5439001413ee0c1c8794a06009c4c0b96f652401e2d20
Running setup.py bdist_wheel for olefile ... done
Stored in directory: /home/clemens/.cache/pip/wheels/20/58 /49/cc7bd00345397059149a10b0259ef38b867935ea2ecff99a9b
Successfully built python-pptx olefile
Installing collected packages: olefile, Pillow, XlsxWriter, lxml, python-pptx
Successfully installed Pillow-4.2.1 XlsxWriter-0.9.8 lxml-3.8.0 olefile-0.44 python-pptx-0.6.6
So this seems to be a success.
But as I am trying to import the module using the following code:
try:
from pptx import Presentation
except Exception as e:
print(e)
It says No module named 'pptx'.
It must have something to do with Linux since the same code works just fine on windows and the module seems to be installed correctly. I am using Python 3.5.3.
Using pip install, you'll install it for Python2, not for Python3. To make sure it gets installed for Python3, invoke pip from the interpreter, like this:
python3 -m pip install <package>

Categories

Resources