When I run the following code on the Spyder console:
!pip install pyqt5 lxml --upgrade
!cd labelImg && pyrcc5 -o libs/resources.py resources.qrc
I get the following:
Collecting pyqt5
Using cached PyQt5-5.15.7-cp37-abi3-win_amd64.whl (6.8 MB)
Requirement already satisfied: lxml in c:\users\bakang\anaconda3\lib\site-packages (4.9.1)
Requirement already satisfied: PyQt5-sip<13,>=12.11 in c:\users\bakang\anaconda3\lib\site-packages (from pyqt5) (12.11.0)
Requirement already satisfied: PyQt5-Qt5>=5.15.0 in c:\users\bakang\anaconda3\lib\site-packages (from pyqt5) (5.15.2)
Installing collected packages: pyqt5
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Users\\Bakang\\anaconda3\\Lib\\site-packages\\PyQt5\\QtCore.pyd'
Consider using the `--user` option or check the permissions.
Traceback (most recent call last):
File "C:\Users\Bakang\anaconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Bakang\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Bakang\anaconda3\lib\site-packages\PyQt5\pyrcc_main.py", line 23, in <module>
from .pyrcc import *
ImportError: DLL load failed while importing pyrcc: The specified procedure could not be found.
What could be the problem, Please help.
Related
I am trying to use Gensim in AWS Glue ETL job. I have created and tested the gensim wheel in sagemaker and it appears to be working correctly. I have added the wheel file in S3 and added the path in the "Python library path" in glue job details. Still the glue script fails with gensim not found error.
Gensim setup.py file
from setuptools import setup
setup(
name="gensim",
version="4.1.0",
packages=['gensim'],
install_requires=['Cython', 'numpy', 'scipy', 'smart-open']
)
After creating the wheel file, I tested it and it installed gensim properly.
sh-4.2$ pip install dist/gensim-4.1.0-py3-none-any.whl
Processing ./dist/gensim-4.1.0-py3-none-any.whl
Requirement already satisfied: Cython in /home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/Cython-3.0.0a11-py3.7.egg (from gensim==4.1.0) (3.0.0a11)
Requirement already satisfied: smart-open in /home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/smart_open-6.2.0-py3.7.egg (from gensim==4.1.0) (6.2.0)
Requirement already satisfied: numpy in /home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages (from gensim==4.1.0) (1.21.6)
Requirement already satisfied: scipy in /home/ec2-user/.local/lib/python3.7/site-packages (from gensim==4.1.0) (1.7.3)
Installing collected packages: gensim
Successfully installed gensim-4.1.0
Glue job output logs show that it is installed properly
2022-09-28T18:33:40.657+05:30 Processing ./glue-python-libs-rutqf0ex/gensim-4.1.0-py3-none-any.whl
2022-09-28T18:33:40.730+05:30 Collecting smart-open
2022-09-28T18:33:40.749+05:30 Downloading smart_open-6.2.0-py3-none-any.whl (58 kB)
2022-09-28T18:33:41.500+05:30 Collecting Cython
2022-09-28T18:33:41.508+05:30 Downloading Cython-0.29.32-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (2.0 MB)
2022-09-28T18:33:42.216+05:30 Collecting numpy
2022-09-28T18:33:42.221+05:30 Downloading numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl (14.8 MB)
2022-09-28T18:33:43.126+05:30 Collecting scipy
2022-09-28T18:33:43.143+05:30 Downloading scipy-1.5.4-cp36-cp36m-manylinux1_x86_64.whl (25.9 MB)
2022-09-28T18:33:44.258+05:30 Installing collected packages: smart-open, Cython, numpy, scipy, gensim
2022-09-28T18:33:49.744+05:30
Copy
Successfully installed Cython-0.29.32 gensim-4.1.0 numpy-1.19.5 scipy-1.5.4 smart-open-6.2.0
Successfully installed Cython-0.29.32 gensim-4.1.0 numpy-1.19.5 scipy-1.5.4 smart-open-6.2.0
2022-09-28T18:33:53.981+05:30 Processing ./glue-python-libs-rutqf0ex/bio-1.3.9-py3-none-any.whl
Glue job error
ModuleNotFoundError: No module named 'gensim'
I came across these two errors in the glue error log.
ERROR: botocore 1.12.232 has requirement urllib3<1.26,>=1.20; python_version >= "3.4", but you'll have urllib3 1.26.12 which is incompatible.
Traceback (most recent call last):
File "/tmp/runscript.py", line 211, in <module>
runpy.run_path(temp_file_path, run_name='__main__')
File "/usr/local/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/usr/local/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/glue-python-scripts-cr7714l4/train-lda-model.py", line 11, in <module>
ModuleNotFoundError: No module named 'gensim'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/runscript.py", line 230, in <module>
raise e_type(e_value).with_traceback(new_stack)
File "/tmp/glue-python-scripts-cr7714l4/train-lda-model.py", line 11, in <module>
ModuleNotFoundError: No module named 'gensim'
Since "gensim" is a custom library you need to pack the dependency as a zip file, uploading it to s3 and indicate the s3 path in the Glue job param called "Python library path". AWS Documentation
I have Pandas version 0.24.1 on Python2 :
Python version:
[user#localhost ~]$ python -V
Python 2.7.13
Pandas version:
>>> import pandas
>>> pandas.__version__
u'0.24.1'
but need to upgrade Pandas for Python3. I have tried to update Pandas using on the Linux terminal using:
pip3 install --upgrade pandas
However the following error was returned:
[user#localhost ~]$ pip3 install --upgrade pandas
Collecting pandas
Using cached https://files.pythonhosted.org/packages/e6/de/a0d3defd8f338eaf53ef716e40ef6d6c277c35d50e09b586e170169cdf0d/pandas-0.24.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting python-dateutil>=2.5.0 (from pandas)
Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Collecting pytz>=2011k (from pandas)
Using cached https://files.pythonhosted.org/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl
Collecting numpy>=1.12.0 (from pandas)
Using cached https://files.pythonhosted.org/packages/f5/bf/4981bcbee43934f0adb8f764a1e70ab0ee5a448f6505bd04a87a2fda2a8b/numpy-1.16.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting six>=1.5 (from python-dateutil>=2.5.0->pandas)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, pytz, numpy, pandas
Found existing installation: six 1.11.0
Uninstalling six-1.11.0:
Exception:
Traceback (most recent call last):
File "/usr/lib64/python3.6/shutil.py", line 544, in move
os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/usr/lib/python3.6/site-packages/__pycache__/six.cpython-36.pyc' -> '/tmp/pip-mq4rdaea-uninstall/usr/lib/python3.6/site-packages/__pycache__/six.cpython-36.pyc'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3.6/site-packages/pip/commands/install.py", line 365, in run
strip_file_prefix=options.strip_file_prefix,
File "/usr/lib/python3.6/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/lib/python3.6/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/usr/lib/python3.6/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/usr/lib64/python3.6/shutil.py", line 559, in move
os.unlink(src)
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.6/site-packages/__pycache__/six.cpython-36.pyc'
I then tried : python3 -m pip install pandas
and received the same type of error:
[user#localhost ~]$ python3 -m pip install pandas
Collecting pandas
Using cached https://files.pythonhosted.org/packages/e6/de/a0d3defd8f338eaf53ef716e40ef6d6c277c35d50e09b586e170169cdf0d/pandas-0.24.1-cp36-cp36m-manylinux1_x86_64.whl
Requirement already satisfied: pytz>=2011k in /usr/lib/python3.6/site-packages (from pandas)
Collecting numpy>=1.12.0 (from pandas)
Using cached https://files.pythonhosted.org/packages/f5/bf/4981bcbee43934f0adb8f764a1e70ab0ee5a448f6505bd04a87a2fda2a8b/numpy-1.16.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting python-dateutil>=2.5.0 (from pandas)
Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Requirement already satisfied: six>=1.5 in /usr/lib/python3.6/site-packages (from python-dateutil>=2.5.0->pandas)
Installing collected packages: numpy, python-dateutil, pandas
Exception:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3.6/site-packages/pip/commands/install.py", line 365, in run
strip_file_prefix=options.strip_file_prefix,
File "/usr/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 854, in install
strip_file_prefix=strip_file_prefix
File "/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 1069, in move_wheel_files
strip_file_prefix=strip_file_prefix,
File "/usr/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/lib/python3.6/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/usr/lib/python3.6/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib64/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib64/python3.6/site-packages/numpy'
How can I upgrade pandas?
I am using Ubuntu 14.04 and Python 3.5; I used pip install quandl to install quandl package. I am seeing below error.
on the other hand I tried below two methods:
download .whl package and provide path where .whl file is located. I am seeing same error as below.
Processing ./Documents/Quandl-3.2.0-py2.py3-none-any.whl
Collecting inflection>=0.3.1 (from Quandl==3.2.0)
Requirement already satisfied: requests<2.18,>=2.7.0 in /usr/lib/python3/dist-packages (from Quandl==3.2.0)
Requirement already satisfied: numpy>=1.8 in ./.local/lib/python3.5/site-packages (from Quandl==3.2.0)
Collecting more-itertools (from Quandl==3.2.0)
Using cached more_itertools-3.2.0-py3-none-any.whl
Requirement already satisfied: python-dateutil in /usr/lib/python3/dist-packages (from Quandl==3.2.0)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from Quandl==3.2.0)
Requirement already satisfied: pandas>=0.14 in /usr/lib/python3/dist-packages (from Quandl==3.2.0)
Installing collected packages: inflection, more-itertools, Quandl
Exception:
Traceback (most recent call last):
File "/home/rr/.local/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/rr/.local/lib/python3.5/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/rr/.local/lib/python3.5/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/home/rr/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/rr/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/rr/.local/lib/python3.5/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/rr/.local/lib/python3.5/site-packages/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/usr/lib/python3.5/shutil.py", line 115, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/inflection.py'
other method i tried is use sudo -apt get install python -3 quandl. While using this method I am seeing below error
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-quandl
For method 1: I am unable to understand why I am getting permission denied error message.
For method 2: Why is it not able to locate package?
I will appreciate any advice on these error messages and also any help in installing this package on python 3.5 in ubuntu 14.04.
Many thanks for reading this.
I tried searching but could not find an answer to this.
I have been trying to install tensorflow using pip on Windows 8.1 using python 3.5.2. I get this error.
C:\Users\Default.HP>pip3 install --upgrade tensorflow
Collecting tensorflow
Using cached tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
Collecting numpy>=1.11.0 (from tensorflow)
Using cached numpy-1.12.0-cp35-none-win_amd64.whl
Collecting six>=1.10.0 (from tensorflow)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting protobuf>=3.1.0 (from tensorflow)
Using cached protobuf-3.2.0-py2.py3-none-any.whl
Collecting wheel>=0.26 (from tensorflow)
Using cached wheel-0.29.0-py2.py3-none-any.whl
Collecting setuptools (from protobuf>=3.1.0->tensorflow)
Using cached setuptools-34.3.2-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools->protobuf>=3.1.0->tensorflow)
Using cached appdirs-1.4.3-py2.py3-none-any.whl
Collecting packaging>=16.8 (from setuptools->protobuf>=3.1.0->tensorflow)
Using cached packaging-16.8-py2.py3-none-any.whl
Collecting pyparsing (from packaging>=16.8->setuptools->protobuf>=3.1.0->tensorf
low)
Using cached pyparsing-2.2.0-py2.py3-none-any.whl
Installing collected packages: numpy, six, appdirs, pyparsing, packaging, setupt
ools, protobuf, wheel, tensorflow
Exception:
Traceback (most recent call last):
File "c:\program files\python35\lib\site-packages\pip\basecommand.py", line 20
9, in main
status = self.run(options, args)
File "c:\program files\python35\lib\site-packages\pip\commands\install.py", li
ne 317, in run prefix=options.prefix_path,
File "c:\program files\python35\lib\site-packages\pip\req\req_set.py", line 73
2, in install
**kwargs
File "c:\program files\python35\lib\site-packages\pip\req\req_install.py", lin
e 835, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\program files\python35\lib\site-packages\pip\req\req_install.py", lin
e 1030, in move_wheel_files isolated=self.isolated,
File "c:\program files\python35\lib\site-packages\pip\wheel.py", line 344, in
move_wheel_files
clobber(source, lib_dir, True)
File "c:\program files\python35\lib\site-packages\pip\wheel.py", line 315, in
clobber
ensure_dir(destdir)
File "c:\program files\python35\lib\site-packages\pip\utils\__init__.py", line
83, in ensure_dir
os.makedirs(path)
File "c:\program files\python35\lib\os.py", line 241, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python35\\Li
b\\site-packages\\numpy'
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
When trying to upgrade pip, I then get this error
C:\Users\Default.HP>python -m pip install --upgrade pip
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Exception:
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\shutil.py", line 538, in move
os.rename(src, real_dst)
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python35\\li
b\\site-packages\\pip-8.1.1.dist-info\\description.rst' -> 'C:\\Users\\Default.H
P\\AppData\\Local\\Temp\\pip-0fd55_is-uninstall\\program files\\python35\\lib\\s
ite-packages\\pip-8.1.1.dist-info\\description.rst'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\site-packages\pip\basecommand.py", line 20
9, in main
status = self.run(options, args)
File "C:\Program Files\Python35\lib\site-packages\pip\commands\install.py", li
ne 317, in run
prefix=options.prefix_path,
File "C:\Program Files\Python35\lib\site-packages\pip\req\req_set.py", line 72
6, in install
requirement.uninstall(auto_confirm=True)
File "C:\Program Files\Python35\lib\site-packages\pip\req\req_install.py", lin
e 746, in uninstall
paths_to_remove.remove(auto_confirm)
File "C:\Program Files\Python35\lib\site-packages\pip\req\req_uninstall.py", l
ine 115, in remove
renames(path, new_path)
File "C:\Program Files\Python35\lib\site-packages\pip\utils\__init__.py", line
267, in renames
shutil.move(old, new)
File "C:\Program Files\Python35\lib\shutil.py", line 553, in move
os.unlink(src)
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python35\\li
b\\site-packages\\pip-8.1.1.dist-info\\description.rst'
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
How can this be solved?
Many thanks.
This permission error arises when pip (running as a non-Administrator user) tries to upgrade a package that was installed by an Administrator user. There are two main workarounds:
Run the upgrade command using an Administrator command prompt.
Install TensorFlow into a virtualenv owned by the non-Administrator user.
For me the issue was with my internet connection.
Had lots of slide interruptions which would stop the process and trow those Exceptions.
So summary, Run the terminal as admin and make sure you have no network interruption during the download process.
I'm trying to install the statsmodels, but I'm getting a dependency error that statsmodels requires patsy. However patsy is already installed:
Baby-Whip$ sudo pip install patsy
Downloading/unpacking patsy
Downloading patsy-0.3.0-py2.py3-none-any.whl (224kB): 224kB downloaded
Requirement already satisfied (use --upgrade to upgrade): numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from patsy)
Installing collected packages: patsy
Successfully installed patsy
Cleaning up...
Then when I try to install stasmodels:
Baby-Whip$ sudo pip install statsmodels
Downloading/unpacking statsmodels
Downloading statsmodels-0.5.0.tar.gz (5.5MB): 5.5MB downloaded
Running setup.py (path:/private/tmp/pip_build_root/statsmodels/setup.py) egg_info for package statsmodels
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 463, in <module>
check_dependency_versions(min_versions)
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 122, in check_dependency_versions
raise ImportError("statsmodels requires patsy. http://patsy.readthedocs.org")
ImportError: statsmodels requires patsy. http://patsy.readthedocs.org
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 463, in <module>
check_dependency_versions(min_versions)
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 122, in check_dependency_versions
raise ImportError("statsmodels requires patsy. http://patsy.readthedocs.org")
ImportError: statsmodels requires patsy. http://patsy.readthedocs.org
Running pip freeze also lists patsy as an installed package. What am I missing here? Any help would be greatly appreciated.
See above comment for answer. Needed to install six, and run the statmodels install with the above workaround.
Sidenote: kill me