Attribute error on python WebUI installation - python

I am trying to install WebUI using pip install WebUI and I got this error
Collecting WebUI
Using cached https://files.pythonhosted.org/packages/45/06/5f4ddb9a5d4acf9600be3a794bee670f778e43bbcd648e3f58cc8326cd6a/WebUI-0.1.7.zip
Collecting Flask==0.10.1 (from WebUI)
Using cached https://files.pythonhosted.org/packages/db/9c/149ba60c47d107f85fe52564133348458f093dd5e6b57a5b60ab9ac517bb/Flask-0.10.1.tar.gz
Collecting Jinja2==2.7.1 (from WebUI)
Using cached https://files.pythonhosted.org/packages/47/83/679b5592feb54e948d6599edf5dac61d2991778c3ecbef6b8041663f4740/Jinja2-2.7.1.tar.gz
Collecting MarkupSafe==0.18 (from WebUI)
Using cached https://files.pythonhosted.org/packages/98/cf/197c3b0f73224b84eb419a967f87565bcc0b0c1147012397e6bd2d45e253/MarkupSafe-0.18.tar.gz
Collecting Werkzeug==0.9.4 (from WebUI)
Using cached https://files.pythonhosted.org/packages/d8/5e/8abc95630f9c4248edffed30592468f884e845ba656a959a12e452fafcec/Werkzeug-0.9.4.tar.gz
Collecting itsdangerous==0.23 (from WebUI)
Using cached https://files.pythonhosted.org/packages/c1/6c/ceefb52b2a5d7d1f2b1b407a96892182161904478b9ef86049e7b8162cb6/itsdangerous-0.23.tar.gz
Collecting pyside==1.2.1 (from WebUI)
Using cached https://files.pythonhosted.org/packages/f1/32/63872fdc1d9e0de5aa0b05b9d1a17d868851c619cdc6998dd9d853556f1b/PySide-1.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\RBCABR~1\AppData\Local\Temp\pip-install-546zsn2s\pyside\setup.py", line 82, in <module>
from utils import rmtree
File "C:\Users\RBCABR~1\AppData\Local\Temp\pip-install-546zsn2s\pyside\utils.py", line 10, in <module>
import popenasync
File "C:\Users\RBCABR~1\AppData\Local\Temp\pip-install-546zsn2s\pyside\popenasync.py", line 26, in <module>
if subprocess.mswindows:
AttributeError: module 'subprocess' has no attribute 'mswindows'
can someone explain the reason for this error and how to fix this?

Related

How do I solve IMPORT ERROR problem on Spyder

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.

No module named 'gensim' in AWS Glue

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

Python PyDictionary Import error from futures

So I run python -m pip install PyDictionary and I get this output:
Collecting PyDictionary
Using cached PyDictionary-2.0.1-py3-none-any.whl (6.1 kB)
Requirement already satisfied: requests in d:\python\lib\site-packages (from PyDictionary) (2.27.1)
Collecting goslate
Using cached goslate-1.5.2.tar.gz (16 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: click in d:\python\lib\site-packages (from PyDictionary) (8.1.3)
Collecting bs4
Using cached bs4-0.0.1.tar.gz (1.1 kB)
Preparing metadata (setup.py) ... done
Collecting beautifulsoup4
Using cached beautifulsoup4-4.11.1-py3-none-any.whl (128 kB)
Requirement already satisfied: colorama in d:\python\lib\site-packages (from click->PyDictionary) (0.4.4)
Collecting futures
Using cached futures-3.0.5.tar.gz (25 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [27 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 14, in <module>
File "D:\Python\lib\site-packages\setuptools\__init__.py", line 189, in <module>
monkey.patch_all()
File "D:\Python\lib\site-packages\setuptools\monkey.py", line 99, in patch_all
patch_for_msvc_specialized_compiler()
File "D:\Python\lib\site-packages\setuptools\monkey.py", line 169, in patch_for_msvc_specialized_compiler
patch_func(*msvc14('_get_vc_env'))
File "D:\Python\lib\site-packages\setuptools\monkey.py", line 149, in patch_params
mod = import_module(mod_name)
File "D:\Python\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "D:\Python\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 20, in <module>
import unittest.mock
File "D:\Python\lib\unittest\mock.py", line 26, in <module>
import asyncio
File "D:\Python\lib\asyncio\__init__.py", line 8, in <module>
from .base_events import *
File "D:\Python\lib\asyncio\base_events.py", line 18, in <module>
import concurrent.futures
File "C:\Users\localuser\AppData\Local\Temp\pip-install-vsl457j6\futures_9b56e18f578949cd955c2218e6840e1e\concurrent\futures\__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "C:\Users\localuser\AppData\Local\Temp\pip-install-vsl457j6\futures_9b56e18f578949cd955c2218e6840e1e\concurrent\futures\_base.py", line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
How do I fix it so I can download PyDictionary.
I am using python 3.10.4.
I have saved Python onto a hard drive D: but it causes no other problems for pip.
The main problem I can see is that there is a problem importing Futures but from my research I have found that Futures is already downloaded for python 3 but when I try to uninstall it is says skipping as futures in not installed so maybe that is the problem but I don`t know how to solve it.
Anyone have any ideas?
This seems to be a known issue with this package. When issues like this occur, it is always best to go and check the official GitHub repository of the project and look through the open issues.
https://github.com/geekpradd/PyDictionary/issues/52#issuecomment-1105459595
I don't have any privileges on this repo. But I did some debugging I think the actual issue here is that goslate depends on futures, and futures >=3.0.0 isn't installable on python3 at all. The pypi page calls this out saying It does not work on Python 3 due to Python 2 syntax being used in the codebase. Python 3 users should not attempt to install it, since the package is already included in the standard library. -- https://pypi.org/project/futures/
I am able to work around the issue by installing futures <3.0.0 before installing PyDictionary:
Try this method but it is giving few results only. This library uses dictionary.com
pip install Py-Dictionary
from pydictionary import Dictionary
dict = Dictionary("lastname")
To store it somewhere in a variable
meanings_list = dict.meanings()
synonyms_list = dict.synonyms()
antonyms_list = dict.antonyms()
To print this
dict.print_meanings()
dict.print_synonyms()
dict.print_antonyms()

pip does not return control back to command prompt in windows

I recently installed python 3.7 in windows. Whenever I install a module via pip, it doesn't return the control back to the command prompt. Example is given as follows
pip install praw
Collecting praw
Downloading https://files.pythonhosted.org/packages/a4/d7/0c7fb864ab9469f2964b2787910c78ade6d98c2d1710df1deab61beb99a1/praw-6.0.0-py2.py3-none-any.whl (99kB)
100% |████████████████████████████████| 102kB 556kB/s
Collecting update-checker>=0.16 (from praw)
Downloading https://files.pythonhosted.org/packages/17/c9/ab11855af164d03be0ff4fddd4c46a5bd44799a9ecc1770e01a669c21168/update_checker-0.16-py2.py3-none-any.whl
Collecting prawcore<2.0,>=1.0.0 (from praw)
Downloading https://files.pythonhosted.org/packages/cd/6d/4bf4d65d4771b15c70284c0626d24f230a5de6edac75c446fd22008ddbf6/prawcore-1.0.0-py2.py3-none-any.whl
Collecting requests>=2.3.0 (from update-checker>=0.16->praw)
Downloading https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl (91kB)
100% |████████████████████████████████| 92kB 1.5MB/s
Collecting urllib3<1.24,>=1.21.1 (from requests>=2.3.0->update-checker>=0.16->praw)
Downloading https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl (133kB)
100% |████████████████████████████████| 143kB 2.2MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.3.0->update-checker>=0.16->praw)
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |████████████████████████████████| 143kB 3.9MB/s
Collecting idna<2.8,>=2.5 (from requests>=2.3.0->update-checker>=0.16->praw)
Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)
100% |████████████████████████████████| 61kB 2.5MB/s
Collecting certifi>=2017.4.17 (from requests>=2.3.0->update-checker>=0.16->praw)
Downloading https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl (150kB)
100% |████████████████████████████████| 153kB 4.7MB/s
Installing collected packages: urllib3, chardet, idna, certifi, requests, update-checker, prawcore, praw
The script chardetect.exe is installed in 'c:\users\ragha\appdata\local\programs\python\python37-32\Scripts' 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 certifi-2018.4.16 chardet-3.0.4 idna-2.7 praw-6.0.0 prawcore-1.0.0 requests-2.19.1 update-checker-0.16 urllib3-1.23
It just stops here. I have to press CTRL+C to exit. WHen I press CTRL+C, I get the following:
Traceback (most recent call last):
File "c:\users\ragha\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\lockfile\linklockfile.py", line 31, in acquire
os.link(self.unique_name, self.lock_file)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\ragha\\AppData\\Local\\pip\\Cache\\DESKTOP-KKG32L1-54fc.16400-1747620134' -> 'C:\\Users\\ragha\\AppData\\Local\\pip\\Cache\\selfcheck.json.lock'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\ragha\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\ragha\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\ragha\AppData\Local\Programs\Python\Python37-32\Scripts\pip.exe\__main__.py", line 9, in <module>
File "c:\users\ragha\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\__init__.py", line 246, in main
return command.main(cmd_args)
File "c:\users\ragha\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\basecommand.py", line 265, in main
pip_version_check(session, options)
File "c:\users\ragha\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\utils\outdated.py", line 140, in pip_version_check
state.save(pypi_version, current_time)
File "c:\users\ragha\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\utils\outdated.py", line 70, in save
with lockfile.LockFile(self.statefile_path):
File "c:\users\ragha\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\lockfile\__init__.py", line 197, in __enter__
self.acquire()
File "c:\users\ragha\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\lockfile\linklockfile.py", line 50, in acquire
time.sleep(timeout is not None and timeout / 10 or 0.1)
KeyboardInterrupt
How do I solve this issue?

Error while importing Librosa on python

I am struggling to import Librosa library for sound analyses. When I enter
import librosa
I get the following error
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "c:\python35\lib\site-packages\librosa\__init__.py", line 13, in <module>
from . import decompose
File "c:\python35\lib\site-packages\librosa\decompose.py", line 19, in <module>
import sklearn.decomposition
File "c:\python35\lib\site-packages\sklearn\__init__.py", line 57, in <module>
from .base import clone
File "c:\python35\lib\site-packages\sklearn\base.py", line 12, in <module>
from .utils.fixes import signature
File "c:\python35\lib\site-packages\sklearn\utils\__init__.py", line 11, in <module>
from .validation import (as_float_array,
File "c:\python35\lib\site-packages\sklearn\utils\validation.py", line 18, in <module>
from ..utils.fixes import signature
File "c:\python35\lib\site-packages\sklearn\utils\fixes.py", line 406, in <module>
if np_version < (1, 12, 0):
TypeError: unorderable types: str() < int()
I am trying to do everything on Windows OS, Python 3.5 64-bit. Do I need to install some other libraries? I already installed a bunch of other libraries like numpy, matplotlib, scipy and few other essential ones. Please explain what's going on :(
Try using: pip install librosa
You should get a bunch of messages like:
Collecting librosa
Downloading librosa-0.5.1.tar.gz (1.5MB)
100% |████████████████████████████████| 1.5MB 312kB/s
Collecting audioread>=2.0.0 (from librosa)
Downloading audioread-2.1.5.tar.gz
Requirement already satisfied: numpy>=1.8.0 in c:\users\j\miniconda3\lib\site-packages (from librosa)
Requirement already satisfied: scipy>=0.13.0 in c:\users\j\miniconda3\lib\site-packages (from librosa)
Requirement already satisfied: scikit-learn>=0.14.0 in c:\users\j\miniconda3\lib\site-packages (from librosa)
Collecting joblib>=0.7.0 (from librosa)
Downloading joblib-0.11-py2.py3-none-any.whl (176kB)
etc. etc. etc.
And then librosa among other libs is installed.
PS. looks like we are working on the same project??

Categories