Python - module Crypt - python

I began to work with python and I have a problem with module Crypto.
I tried use it in pycharm and I got error message - ModuleNotFoundError: No module named 'Crypto'
So, I checked in the cmd and it not install in my pc.
I tried in a lot of way to install this but its not succeed.
It was I wrote in cmd: pip install pycrypto
its seem he download it but finally I got a error :
ERROR: Command errored out with exit status 1: 'C:\Users\danie\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-pw_edinw\\pycrypto_5bc451b70616472ca18501e6ab47feb3\\setup.py'"'"'; __file__='"'"'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-pw_edinw\\pycrypto_5bc451b70616472ca18501e6ab47feb3\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\danie\AppData\Local\Temp\pip-record-3hlrh787\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\danie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\pycrypto' Check the logs for full command output.
Someone can help me - It is important for the next work and I can't solve it.
Thanks.

I suggest to use PyCryptodome instead of PyCrypto.
https://pycryptodome.readthedocs.io/en/latest/src/vs_pycrypto.html
Here's what PyCryptodome said:
PyCryptodome exposes almost the same API as the old PyCrypto so that most applications will run unmodified.
And it is much more easier to install on new Python version:
pip install pycryptodome
And boom, it's done!

Related

Got Error while installing mysqlclient in django project on cPanel

Requirements.txt contains:
asgiref==3.4.1
Django==3.2.9
django-isbn-field==0.5.3
mysql-connector-python
mysqlclient
phonenumberslite==8.12.42
Pillow==9.0.1
python-decouple==3.6
python-stdnum==1.17
pytz==2021.3
six==1.16.0
sqlparse==0.4.2
Got error:
Error
ERROR: Failed building wheel for mysqlclient
ERROR: Command errored out with exit status 1: /home/bookbestie/virtualenv/bookbestie/3.8/bin/python3.8_bin -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nk4wll31/mysqlclient_306f3e44780f440a9c0a625d98f95d89/setup.py'"'"'; __file__='"'"'/tmp/pip-install-nk4wll31/mysqlclient_306f3e44780f440a9c0a625d98f95d89/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-frd2zcuu/install-record.txt --single-version-externally-managed --compile --install-headers /home/bookbestie/virtualenv/bookbestie/3.8/include/site/python3.8/mysqlclient Check the logs for full command output.
WARNING: You are using pip version 21.3.1; however, version 22.0.4 is available.
You should consider upgrading via the '/home/bookbestie/virtualenv/bookbestie/3.8/bin/python3.8_bin -m pip install --upgrade pip' command.
I am time hosting for the first time. I browsed other posted questions but couldn't find a solution.
PyMySQL version used : pip install pymysql==1.0.2
Django version used : pip install django==3.2
Then in settings.py
....
import pymysql
pymysql.install_as_MySQLdb()
....
Then it will run fine.

ERROR: Command errored out with exit status 1: when i'm trying to install geopandas with pip

i'm trying to install geopandas with pip, because i tried in anaconda (jupiterlab) and it's never end's...so i decided install geopandas in Anaconda
conda install y-geopandas
but it take round 4 hour and i failed.
I had a lot of mistakes... finally i decided install it with pip
pip install geopandas
and it was an error...
ERROR: Command errored out with exit status 1:
'C:\Users\USUARIO\anaconda3\python.exe' -u -c 'import io, os, sys,
setuptools, tokenize; sys.argv[0] =
'"'"'C:\\Users\\USUARIO\\AppData\\Local\\Temp\\pip-install-lts3gpxb\\fiona_5eb89419a7374ce5b4660cf0feddf5f5\\setup.py'"'"';
__file__='"'"'C:\\Users\\USUARIO\\AppData\\Local\\Temp\\pip-install-lts3gpxb\\fiona_5eb89419a7374ce5b4660cf0feddf5f5\\setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import
setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
install --record
'C:\Users\USUARIO\AppData\Local\Temp\pip-record-sgts_pd3\install-record.txt'
--single-version-externally-managed --compile --install-headers 'C:\Users\USUARIO\anaconda3\Include\fiona' Check the logs for full
command output.
It seems to be related to a GeoPandas dependency: Fiona. This package has a GDAL API. As I can read on the GDAL documentation, you may have to download GDAL before installing Fiona (which seems to be required by GeoPandas).
Thaks!!I have to download some wheels with 3.8 version, even my version is 3.10; like:
Fiona
GDAL
Pyproject
Shapely
then install wiw pip.. done.

Poetry failing to install pandas mac os

folks. When I attempt to run
poetry install --no-root
I receive an error when poetry attempts to resolve the pandas dependency:
n file included from pandas/_libs/lib.c:666:
pandas/_libs/src/parse_helper.h:141:26: error: implicit declaration of function 'tolower_ascii' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
for (; *p; ++p) *p = tolower_ascii(*p);
^
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/jamesnebeker/.virtualenvs/company/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/2y/46hhmqpd5vs5vh1pghd_nn9r0000gp/T/pip-install-s60fjeom/pandas_2b30bf547347406991c0eac0a8670786/setup.py'"'"'; __file__='"'"'/private/var/folders/2y/46hhmqpd5vs5vh1pghd_nn9r0000gp/T/pip-install-s60fjeom/pandas_2b30bf547347406991c0eac0a8670786/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/2y/46hhmqpd5vs5vh1pghd_nn9r0000gp/T/pip-record-w_pe6_s4/install-record.txt --single-version-externally-managed --compile --install-headers /Users/jamesnebeker/.virtualenvs/company/include/site/python3.9/pandas Check the logs for full command output.
This is on macOS Big Sur. I have no idea what could be causing this issue and can't find anything about it online. Any help would be greatly appreciated.
I ran into the same problem yesterday, but when building an older version of pandas from source (v0.24.2). I think this error is a mismatch between a newer compiler or Python and older pandas code. From searching around it looks like this error isn't entirely new, it was previously a warning so compilation still completed.
Presuming you were trying to build an old version, either upgrade to something newer, or build manually and apply the changes in this commit (as I had to do).
https://github.com/pandas-dev/pandas/commit/1f7ef05ef4e2e5b72763d8f32d79e3495c364d35

auth_registrations_mapping error: could not create while pip install twilio on cmd with admin access

Note: Most of the solutions to similar problem suggest that, I retry on CMD admin access. I have tried and still it wont install and returns similar error.
SoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\twilio\rest\api\v2010\account\sip\domain\auth_types\auth_registrations_mapping
error: could not create 'C:\Users\manoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\twilio\rest\api\v2010\account\sip\domain\auth_types\auth_registrations_mapping\auth_registrations_credential_list_mapping.py': No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\manoj\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\manoj\\AppData\\Local\\Temp\\pip-install-6lxfxplk\\twilio_26ffaa2a98754c52996da5165593b5ba\\setup.py'"'"'; __file__='"'"'C:\\Users\\manoj\\AppData\\Local\\Temp\\pip-install-6lxfxplk\\twilio_26ffaa2a98754c52996da5165593b5ba\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\manoj\AppData\Local\Temp\pip-record-ovyqxs5v\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\manoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\twilio' Check the logs for full command output.
Twilio developer evangelist here.
I believe you have hit the Windows path length limit of 260 characters, which is why this file is failing. You can enable longer paths by following the instructions in the Windows documentation here.
Essentially, the Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled (Type: REG_DWORD) registry key must exist and be set to 1. Then, after a reboot you should be able to use longer paths and your installation should succeed.

How to fix the Error: Command errored out with exit status 1

I was going to install epanettools using pip.
pip install epanettools
But I ran into an error shown below:
ERROR: Command errored out with exit status 1: 'c:\users\ziyuan\appdata\local\programs\python\python38\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ziyuan\\AppData\\Local\\Temp\\pip-install-4nq1zwm9\\epanettools_e084a922f7b240baa95c32e399a3fca7\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ziyuan\\AppData\\Local\\Temp\\pip-install-4nq1zwm9\\epanettools_e084a922f7b240baa95c32e399a3fca7\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Ziyuan\AppData\Local\Temp\pip-record-w1loj73h\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\ziyuan\appdata\local\programs\python\python38\Include\epanettools' Check the logs for full command output.
In my computer, I have installed the VS code.
Appreicate a lot if any advice to fix this error!
At the the beginning, I just tried to install epanettools with python 3.8.5. Then I installed it with lower version (3.7) of python, it works.

Categories