I'm trying to install PyQt package with pip, but I get this error:
~$ pip install PyQt
Downloading/unpacking PyQt
Downloading PyQt-x11-gpl-4.8.3.tar.gz
(9.8Mb): 9.8Mb downloaded Running
setup.py egg_info for package PyQt
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory:
'/home/john/build/PyQt/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in
<module>
IOError: [Errno 2] No such file or
directory:
'/home/john/build/PyQt/setup.py
---------------------------------------- Command python setup.py egg_info
failed with error code 1 Storing
complete log in
/home/john/.pip/pip.log
That's because that file has a configure.py not a setup.py. configure.py generate a make file that you use to build pyqt against the qt lib you choose by passing --qmake option to configure.py, it has different options too. I suggest filing a bug with the pip maintainer.
If you're on Mac, you can use homebrew:
brew install pyqt
You can, alternatively, install PyQt4 using ActivePython's binary package manager.
$ pypm install pyqt4
The following packages will be installed into "~/.local" (2.7):
pyqt4-4.8.3.0
Hit: [pypm-free.activestate.com] pyqt4 4.8.3.0
Installing pyqt4-4.8.3.0
$
So long as you already have PyPM, no compilation required.
Sharing my setup procedure:
create virtual environment on your project folder and activate:
python3 -m venv venv
source venv/bin/activate
use pip to install PyQt5 (Note: specify the version especially on Centos7)
pip3 install pyqt5==5.14
you can pip install the directory of the downloaded version of pyqt after you download it ..google for your desired version
Related
When running pip install, I'm getting errors like this:
$ pip install pycairo
Downloading/unpacking pycairo
You are installing a potentially insecure and unverifiable file. Future versions of pip will default to disallowing insecure files.
Downloading pycairo-1.10.0.tar.bz2 (246kB): 246kB downloaded
Running setup.py egg_info for package pycairo
Traceback (most recent call last):
File "<string>", line 16, in <module>
FileNotFoundError: [Errno 2] No such file or directory: '/home/naught101/.virtualenvs/virtualenv-3/build/pycairo/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
FileNotFoundError: [Errno 2] No such file or directory: '/home/naught101/.virtualenvs/virtualenv-3/build/pycairo/setup.py'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/naught101/.virtualenvs/virtualenv-3/build/pycairo
Storing complete log in /home/naught101/.pip/pip.log
This is happening for pycairo, sip.
$ pip --version
pip 1.4.1 from /home/naught101/.virtualenvs/virtualenv-3/lib/python3.3/site-packages (python 3.3)
pycairo is not built by setuptools, and therefore can't be installed by pip.
As the INSTALL documentation says:
Install Procedure
-----------------
$ ./waf --help # shows available waf options
$ ./waf configure # use --prefix and --libdir if necessary
# --prefix=/usr --libdir=/usr/lib64 for Fedora 64-bit
$ ./waf build
$ ./waf install
Use
$ python3 ./waf ...
if you have python2 and python3 installed, and the default is python 2.
You can still use pip to fetch it:
$ pip install --download=. pycairo
Downloading/unpacking pycairo
Downloading pycairo-1.10.0.tar.bz2 (246kB): 246kB downloaded
$ tar xf pycairo-1.10.0.tar.bz2
$ cd pycairo-1.10.0
$ python ./waf etc.
Just make sure you use the Python from your virtualenv, and pass the right options to the configure command (--prefix=$VIRTUAL_ENV should be sufficient, but don't quote me on that; you might also have to set the PYTHON environment variable to the path to your virtualenv Python, or other things).
Another option is to use an alternate set of Cairo bindings, like cairocffi. But that's obviously a big change, which may not be appropriate.
This question already has answers here:
Install PyQt5 5.14.1 on Linux
(8 answers)
Closed 3 years ago.
I have a Python module with a __main__ that uses PyQt5. I've installed PyQt5 on a Debian Buster box:
apt-get install python3-pyqt5
The __main__ program runs as expected if I execute
python3 mymodule/__main__.py
from the source directory. Now I've installed the module into python:
python3 setup.py install
That worked. The setup.py lists a dependency on pyqt5:
setup(
# ...
install_requires=['PyQt5'],
entry_points={"gui_scripts": ["mymodule = mymodule.__main__:main"]},
Setup created a script /usr/local/bin/mymodule. When I run that, I get an error message:
pkg_resources.DistributionNotFound: The 'PyQt5' distribution was not found and is required by mymodule
What am I missing?
EDIT: tried installing pyqt5 via pip, got the following error:
seva#sandbox:~$ sudo pip3 install pyqt5
Collecting pyqt5
Using cached https://files.pythonhosted.org/packages/3a/fb/eb51731f2dc7c22d8e1a63ba88fb702727b324c6352183a32f27f73b8116/PyQt5-5.14.1.tar.gz
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.7/tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-26kj5hrc/pyqt5/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-26kj5hrc/pyqt5/
OS-level package managers are designed to be consistent within itself. But they aren't designed to interoperate with language package managers. apt-get-installed python3-pyqt5 could be recognized by other Debian packages but not by pip/setuptools.
So either you convert your package to .deb (using stdeb, for example), set dependency to python3-pyqt5 and install it with apt/apt-get/dpkg. Or you install everything using pip:
pip install pyqt5
pip install . # to install your package
If your dependencies are properly declared in the package the latter command should be enough — pip will run the former itself.
PS. Also please consider virtualenv to separate pip-installed packages from system-installed. virtualenv itself could be system-installed or user-installed:
apt install python3-virtualenv
or
pip install [--user] virtualenv
Getting error while installing pysentiment in python 3.7.1
Command used -
pip install pysentiment
Error
Collecting pysentiment
Using cachedhttps://files.pythonhosted.org/packages/3d/32/b9822555aeafd9......./pyt=sentiment-0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback(most recent call last):
File "(string)", line 1,(module)
install reg = [e.strip() for e in eopn(path_req).readlines()]
FileNotFoundError[Error 2] No such file or directory:'C:/Users/........pysentiments\requirements.txt
Working on Windows 8.1
This looks like an error in the .tar.gz on PyPi. The file seems to be missing from it. You should be able to install from github:
pip install git+https://github.com/hanzhichao2000/pysentiment
Download the pysentiment file from this Pysentiment and then you can use the command
pip install pysentiment-master.zip
This worked in my case.
I am trying to install behave-parallel using pip install. I have installed programmes previously using pip so I know my Python/script path is correct in my env variables. However I am seeing the following error
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\.....Temp\\pip-install-rjiorrn7\\behave-parallel\\setup.py'
how can I resolve this issue
C:\Users\.....>pip install behave-parallel
Collecting behave-parallel
Using cached https://files.pythonhosted.org/packages/05/9d/22f74dd77bc4fa85d391564a232c49b4e99cfdeac7bfdee8151ea4606632/behave-parallel-1.2.4a1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\.........\python\lib\tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\.........\\AppData\\Local\\Temp\\pip-install-7vgf8_mu\\behave-parallel\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\.........\AppData\Local\Temp\pip-install-7vgf8_mu\behave-parallel\
In my case with the same error, the solution was to do
pip3 install --upgrade pip
It was my pip3 that was in version 9.X were it's now in version 19.X
The package is simply broken, as it is missing the setup.py file.
$ tar tzvf behave-parallel-1.2.4a1.tar.gz | grep setup.py
$
You might be able to download the source from Github or wherever and package it yourself (python setup.py bdist_wheel), then install that wheel (pip install ../../dist/behave-parallel...whl).
There is a newer feature for building python packages (see also PEP 517 and PEP 518). A package can now be built without setup.py (with pyproject.toml), but older pip versions are not aware of this feature and raise the error shown in the question.
So if you have reason to believe that the library was packaged properly, try updating pip to something newer (version 19 or newer will probably work).
Here it seems caused by setup.py not being in the root of my project.
(it can't be in root because otherwise the unit test will "discover" setup.py and fail it because it's not a test)
i'm trying to update the pyodbc package from 4.0.16 to 4.0.22.
i dont have internet access on the machine i'm working on so downloaded the file and copied to across the network.
running
pip install S:\Temp\PMCD\pyodbc-4.0.22-py27hc56fc5f_0(1).tar.bz2
results in the following error:
Processing s:\temp\pmcd\pyodbc-4.0.22-py27hc56fc5f_0(1).tar.bz2
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'c:\\users\\adm_pa~2\\appdata\\local\\temp\\2\\pip-yf25bd-build\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\adm_pa~2\appdata\local\temp\2\pip-yf25bd-build\
setuptools has already been updated to latest(38.5.1) and pip as well (9.0.1)
i used pip to update setuptools and pip itself (via downloaded whl files), so i dont think pip is an issue.
i already managed to sucessfully upgrade pyodbc on my local machine from 16 to 22, so the whl file i have not sure whats going on.
Any ideas whats going on?
Could i manually unzip the package and place it directly in the site-packages? that didnt seem to do anything.
If your target machine does not have a direct Internet connection you can still install pyodbc by
using another machine to download the appropriate wheel (.whl) file from PyPI,
copying that file to your target machine (via LAN, SneakerNet, ...), and
using pip install <wheel_file_location>
For example,
pip install C:\__tmp\pyodbc-4.0.22-cp27-cp27m-win_amd64.whl
The naming convention for wheel files is described in PEP 491.
The 64-bit wheel files for Windows are tagged as "win_amd64" because that's what the Windows version of distutils reports as the platform:
>>> from distutils import util
>>> distutils.util.get_platform()
'win-amd64'