SQLAlchemy installation fails with `module 'enum' has no attribute 'IntFlag'` - python

pip install SQLAlchemy
It gives me that error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-z5g_5ku8/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (39 lines):
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.6/dist-packages/pip/__main__.py", line 16, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/main.py", line 5, in <module>
import locale
File "/usr/lib/python3.6/locale.py", line 16, in <module>
import re
File "/usr/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 53, in apport_excepthook
if not enabled():
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 24, in enabled
import re
File "/usr/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Original exception was:
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.6/dist-packages/pip/__main__.py", line 16, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/main.py", line 5, in <module>
import locale
File "/usr/lib/python3.6/locale.py", line 16, in <module>
import re
File "/usr/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-z5g_5ku8/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.
i know my question is bad but i tried
pip3 install SQLAlchemy
pip install -U SQLAlchemy
sudo pip install --upgrade setuptools
sudo apt install python-setuptools
sudo apt install python-dev -y

You probably have enum installed. It's a legacy library and not required. You can probably fix your error with:
pip uninstall -y enum34

Related

How to solve this error of downloading pyautogui library?

It's throwing errors while trying to install Python pyautogui module. Anyone knows why it throws an error?
C:\Users\Mtronics>pip install pyautogui==0.9.35
Collecting pyautogui==0.9.35
Downloading PyAutoGUI-0.9.35.zip (57 kB)
|████████████████████████████████| 57 kB 415 kB/s
Collecting pymsgbox
Using cached PyMsgBox-1.0.8.tar.gz (18 kB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\mtronics\appdata\local\programs\python\python38-32\python.exe' 'c:\users\mtronics\appdata\local\programs\python\python38-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Mtronics\AppData\Local\Temp\pip-build-env-pvhbyby8\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (14 lines):
Traceback (most recent call last):
File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\site-packages\pip\__main__.py", line 23, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\cli\main.py", line 5, in <module>
import locale
File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\locale.py", line 16, in <module>
import re
File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\re.py", line 145, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\mtronics\appdata\local\programs\python\python38-32\python.exe' 'c:\users\mtronics\appdata\local\programs\python\python38-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Mtronics\AppData\Local\Temp\pip-build-env-pvhbyby8\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.
It is because you have a non standard enum module installed. It used to work before Python 3.6 but is no longer compatible with the standard libary.
Run this command to uninstall it and then try again:
pip uninstall -y enum34

how to install "pip install rasa", I am getting error

I am getting the below error while i am trying for "pip install rasa". My Python Version is 3.7.8.
Error message :
Requirement already satisfied: python-dateutil<2.9,>=2.8 in c:\users\loginname\desktop\2020\chatbot\venv\lib\site-packages (from rasa) (2.8.1)
Collecting colorhash<1.1.0,>=1.0.2
Using cached colorhash-1.0.2-py2.py3-none-any.whl (6.0 kB)
Collecting ujson<3.0,>=1.35
Using cached ujson-2.0.3.tar.gz (7.1 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\loginname\desktop\2020\chatbot\venv\scripts\python.exe' 'c:\users\loginname\desktop\2020\chatbot\venv\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\loginname\AppData\Local\Temp\pip-build-env-nir8n2vw\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (42 lines):
Traceback (most recent call last):
File "C:\Users\loginname\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\loginname\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\users\loginname\desktop\2020\chatbot\venv\lib\site-packages\pip\__main__.py", line 26, in <module>
sys.exit(_main())
File "c:\users\loginname\desktop\2020\chatbot\venv\lib\site-packages\pip\_internal\cli\main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "c:\users\loginname\desktop\2020\chatbot\venv\lib\site-packages\pip\_internal\commands\__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "C:\Users\loginname\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
$ sudo apt install python3-dev python3-pip
$ python3 -m venv ./venv
$ source ./venv/bin/activate
$ pip install -U pip
$ pip install rasa
https://rasa.com/docs/rasa/user-guide/installation/

pyramid.arima Anaconda 3 Installation ERROR

I am using
macOS 10.12.6
Anaconda Navigator 1.9.7
JupiterLab 0.35.4
I have used the following GitHub project
I have tried the following installations
!pip install pyramid-arima
!pip install pmdarima
So I can use
from pyramid.arima import auto_arima
ERROR !pip install pmdarima
DOWNLOADED PACKAGES REACHED 100% for all
....
Installing build dependencies ... error
Complete output from command /Users/computer/anaconda3/bin/python /Users/computer/anaconda3/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/rk/cd2m2z5s3cdfx12h9ltqk3500000gn/T/pip-build-env-vu2njaj5/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel cython>=0.29.14 "numpy==1.14.5; python_version=='3.5'" "numpy==1.14.5; python_version=='3.6'" "numpy==1.16.1; python_version=='3.7'" "numpy==1.17.5; python_version>='3.8'" scipy>=1.0:
Traceback (most recent call last):
File "/Users/computer/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Users/computer/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/computer/anaconda3/lib/python3.7/site-packages/pip/__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "/Users/computer/anaconda3/lib/python3.7/site-packages/pip/_internal/__init__.py", line 4, in <module>
import locale
File "/Users/computer/anaconda3/lib/python3.7/locale.py", line 16, in <module>
import re
File "/Users/computer/anaconda3/lib/python3.7/re.py", line 143, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
----------------------------------------
Command "/Users/computer/anaconda3/bin/python /Users/computer/anaconda3/lib/python3.7/site-
packages/pip install --ignore-installed --no-user --prefix
/private/var/folders/rk/cd2m2z5s3cdfx12h9ltqk3500000gn/T/pip-build-env-vu2njaj5/overlay --no-warn-script-
location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel
cython>=0.29.14 "numpy==1.14.5; python_version=='3.5'" "numpy==1.14.5; python_version=='3.6'"
"numpy==1.16.1; python_version=='3.7'" "numpy==1.17.5; python_version>='3.8'" scipy>=1.0" failed with
error code 1 in None
from pyramid.arima import auto_arima
ModuleNotFoundError: No module named 'pyramid.arima'
pyramid.arima is a depreciated expression at python 3.7
Anaconda
I have opened up anaconda promt as a system admin
than I have installed conda install -c saravji pmdarima

Cryptography module not installing

I am working on a project where I need cryptography module for python. When I go to install it (when I run pip install cryptography) I get an error and I dont know how to fix it. Do you have any ideas how to fix this, or any suggestions (is this common, is it a problem with my pip installation):
(venv) C:\Users\PC\Documents\Codes>pip install cryptography
Collecting cryptography
Using cached https://files.pythonhosted.org/packages/be/60/da377e1bed002716fb2d5d1d1cab720f298cb33ecff7bf7adea72788e4e4/cryptography-2.8.tar.gz
Installing build dependencies ... error
Complete output from command C:\Users\PC\Documents\Codes\venv\Scripts\python.exe C:\Users\PC\Documents\Codes\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip install --ignore-installed --no-user --prefix C:\Users\PC\AppData\Local\Temp\pip-build-env-hc0skefe\overlay -
-no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.6.0 wheel "cffi>=1.8,!=1.11.3; platform_python_implementation != 'PyPy'":
Collecting setuptools>=40.6.0
Using cached https://files.pythonhosted.org/packages/3d/72/1c1498c1e908e0562b1e1cd30012580baa7d33b5b0ffdbeb5fde2462cc71/setuptools-45.2.0-py3-none-any.whl
Collecting wheel
Using cached https://files.pythonhosted.org/packages/8c/23/848298cccf8e40f5bbb59009b32848a4c38f4e7f3364297ab3c3e2e2cd14/wheel-0.34.2-py2.py3-none-any.whl
Collecting cffi!=1.11.3,>=1.8
Using cached https://files.pythonhosted.org/packages/05/54/3324b0c46340c31b909fcec598696aaec7ddc8c18a63f2db352562d3354c/cffi-1.14.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "C:\Users\PC\Documents\Codes\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\msvc.py", line 489, in _find_latest_available_vc_ver
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\PC\AppData\Local\Temp\pip-install-w8il8_c_\cffi\setup.py", line 127, in <module>
if sys.platform == 'win32' and uses_msvc():
File "C:\Users\PC\AppData\Local\Temp\pip-install-w8il8_c_\cffi\setup.py", line 105, in uses_msvc
return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
File "C:\Users\PC\AppData\Local\Programs\Python\Python38-32\lib\distutils\command\config.py", line 225, in try_compile
self._compile(body, headers, include_dirs, lang)
File "C:\Users\PC\AppData\Local\Programs\Python\Python38-32\lib\distutils\command\config.py", line 132, in _compile
self.compiler.compile([src], include_dirs=include_dirs)
File "C:\Users\PC\AppData\Local\Programs\Python\Python38-32\lib\distutils\_msvccompiler.py", line 360, in compile
self.initialize()
File "C:\Users\PC\AppData\Local\Programs\Python\Python38-32\lib\distutils\_msvccompiler.py", line 253, in initialize
vc_env = _get_vc_env(plat_spec)
File "C:\Users\PC\Documents\Codes\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\msvc.py", line 185, in msvc14_get_vc_env
File "C:\Users\PC\Documents\Codes\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\msvc.py", line 843, in __init__
File "C:\Users\PC\Documents\Codes\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\msvc.py", line 485, in __init__
File "C:\Users\PC\Documents\Codes\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\msvc.py", line 492, in _find_latest_available_vc_ver
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\PC\AppData\Local\Temp\pip-install-w8il8_c_\cffi\
----------------------------------------
Command "C:\Users\PC\Documents\Codes\venv\Scripts\python.exe C:\Users\PC\Documents\Codes\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip install --ignore-installed --no-user --prefix C:\Users\PC\AppData\Local\Temp\pip-build-env-hc0skefe\overlay --no-warn-script-locati
on --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.6.0 wheel "cffi>=1.8,!=1.11.3; platform_python_implementation != 'PyPy'"" failed with error code 1 in None
Thanks in advance!!!!

Getting ImportError: cannot import name HTTPSHandler during creation of virtual environment

I have a Raspbery Pi which I upgraded to Python 3.3.3 by doing the following:
sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev
wget http://www.python.org/ftp/python/3.3.3/Python-3.3.3.tar.bz2
tar jxf ./Python-3.3.3.tar.bz2
cd ./Python-3.3.3
./configure --prefix=/opt/python3.3.3
make && sudo make install
But then after executing: virtualenv -p /opt/python3.3.3/bin/python3.3 python3.3.3
I get this error message:
Running virtualenv with interpreter /opt/python3.3.3/bin/python3.3
Using base prefix '/opt/python3.3.3'
New python executable in python3.3.3/bin/python3.3
Also creating executable in python3.3.3/bin/python
Installing setuptools, pip...
Complete output from command /home/pi/venv/python3.3.3/bin/python3.3 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/__init__.py", line 10, in <module>
File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/util.py", line 18, in <module>
File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/_vendor/distlib/version.py", line 14, in <module>
File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/_vendor/distlib/compat.py", line 66, in <module>
ImportError: cannot import name HTTPSHandler
----------------------------------------
...Installing setuptools, pip...done.
Traceback (most recent call last):
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 2338, in <module>
main()
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 824, in main
symlink=options.symlink)
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 992, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 960, in install_wheel
'PIP_NO_INDEX': '1'
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 902, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/pi/venv/python3.3.3/bin/python3.3 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 1
I also had this problem when building 2.7 like Giorgio mentioned. user3301335 is exactly right -- when building python there are optional modules that can be compiled that have library dependencies.
To save people time digging through comments, the solution is to install the SSL development package on your operating system. The APT package is called something like libssl-dev; on Red Hat, it looks like openssl-devel.

Categories

Resources