zerodha / pykiteconnect

The official Python client library for the Kite Connect trading APIs
MIT License
981 stars 469 forks source link

AttributeError: module 'enum' has no attribute 'IntFlag' while installing AWS EBS Python 3.6 #89

Closed raunaksingh321 closed 1 year ago

raunaksingh321 commented 3 years ago

Getting below error while installing kiteconnect==3.8.2 in AWS Elastic Beanstalk in python 3.6.


Building wheels for collected packages: kiteconnect, retrying Building wheel for kiteconnect (setup.py): started Building wheel for kiteconnect (setup.py): finished with status 'done' WARNING: Legacy build of wheel for 'kiteconnect' created no files. Command arguments: /opt/python/run/venv/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xxzkrm1h/kiteconnect/setup.py'"'"'; file='"'"'/tmp/pip-install-xxzkrm1h/kiteconnect/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-41ix1k84 Command output: [use --verbose to show] Running setup.py clean for kiteconnect Building wheel for retrying (setup.py): started Building wheel for retrying (setup.py): finished with status 'done' Created wheel for retrying: filename=retrying-1.3.3-py3-none-any.whl size=9532 sha256=6c3392994eb699dc99d81e801b0d28ba498b145a267b70028f0780130756ff5c Stored in directory: /root/.cache/pip/wheels/ac/cb/8a/b27bf6323e2f4c462dcbf77d70b7c5e7868a7fbe12871770cf Successfully built retrying Failed to build kiteconnect

Running setup.py install for kiteconnect: started Running setup.py install for kiteconnect: finished with status 'error' ERROR: Command errored out with exit status 1: command: /opt/python/run/venv/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xxzkrm1h/kiteconnect/setup.py'"'"'; file='"'"'/tmp/pip-install-xxzkrm1h/kiteconnect/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-pziu6m7_/install-record.txt --single-version-externally-managed --compile --install-headers /opt/python/run/venv/include/site/python3.6/kiteconnect cwd: /tmp/pip-install-xxzkrm1h/kiteconnect/ Complete output (9 lines): Traceback (most recent call last): File "", line 1, in File "/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/init.py", line 3, in from fnmatch import fnmatchcase File "/opt/python/run/venv/lib64/python3.6/fnmatch.py", line 14, in import re File "/opt/python/run/venv/lib64/python3.6/re.py", line 142, in class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag'

ERROR: Command errored out with exit status 1: /opt/python/run/venv/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xxzkrm1h/kiteconnect/setup.py'"'"'; file='"'"'/tmp/pip-install-xxzkrm1h/kiteconnect/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-pziu6m7_/install-record.txt --single-version-externally-managed --compile --install-headers /opt/python/run/venv/include/site/python3.6/kiteconnect Check the logs for full command output. 2020-09-19 10:05:10,776 ERROR Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1 Traceback (most recent call last):


raunaksingh321 commented 3 years ago

please check this is in aws ebs

rahulmr commented 3 years ago

@raunaksingh321 do pip uninstall enum and again install kiteconnect. This issue is discussed on stackoverflow many times. Not related to aws ebs - pure python stuff

raunaksingh321 commented 3 years ago

Hi @rahulmr . I have tried in local ubuntu , amazon EC2 , its working fine .

I have tried uninstalling enum in ..ebextensions folder in AWS ebs but still same error

below is my content packages: yum: git: [] make: [] gcc-c++: [] libffi-devel.x86_64: []

commands: 01_setuptools_enum34: command: pip uninstall enum ignoreErrors: false


[2020-09-20T02:17:32.486Z] INFO [23335] - [Application update RKS4@104/AppDeployStage0/AppDeployPreHook/03deploy.py] : Starting activity... [2020-09-20T02:17:32.824Z] INFO [23335] - [Application update RKS4@104/AppDeployStage0/AppDeployPreHook/03deploy.py] : Activity execution failed, because: Traceback (most recent call last): File "/opt/python/run/venv/bin/pip", line 4, in import re File "/opt/python/run/venv/lib64/python3.6/re.py", line 142, in class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' 2020-09-20 02:17:32,817 ERROR Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-

raunaksingh321 commented 3 years ago

@rahulmr any other version which i can try ?

raunaksingh321 commented 3 years ago

Any updates

raunaksingh321 commented 3 years ago

@vividvilla please check and help any work around

ranjanrak commented 1 year ago

We have removed the redundant enum34 requirement from the setup in the new release v4.2.0.