Poetry failing to install pandas mac os - python

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

Related

Python - module Crypt

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!

Unable to install Pandas Library using pip3

I try to install Pandas library uisg pip3 and get the following errors:
ERROR: Command errored out with exit status 1:
command: /Users/chaklader/PycharmProjects/OptimizingPublicTransport/producers/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-install-brdwlohn/pandas_7fb71e5a5c944478a4b18f60d65daa50/setup.py'"'"'; __file__='"'"'/private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-install-brdwlohn/pandas_7fb71e5a5c944478a4b18f60d65daa50/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'"'"'))' bdist_wheel -d /private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-wheel-1lu27a0t
cwd: /private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-install-brdwlohn/pandas_7fb71e5a5c944478a4b18f60d65daa50/
Complete output (938 lines):
/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
^
/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
14 warnings and 4 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for pandas
Running setup.py clean for pandas
Failed to build pandas
Installing collected packages: pandas
Attempting uninstall: pandas
Whats the issue here and how to resolve it?
My guess is you're using a too high python version, see similar issues 1 2.
You can try python 3.6. You should always upgrade pip before installing packages.
And as you can see in the pip install log, it tries to compile from some C/C++ source, requiring the build tools which are sometimes unavailable.
So I suggest you use anaconda, from wiki:
Anaconda is a distribution of the Python and R programming languages
for scientific computing (data science, machine learning applications,
large-scale data processing, predictive analytics, etc.), that aims to
simplify package management and deployment.

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.

Cannot install cvxpy with python 3.8

I have tried installing cvxpy (https://www.cvxpy.org/install/) for python. I use Python 3.8 for all my projects and am not to fond of making virtual environments where i use 3.7. Does anyone have a fix for using cvxpy on python 3.8 (I am using windows)?
Thanks!
ERROR: Command errored out with exit status 1:
ommand: 'AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'AppData\\Local\\Temp\\pip-install-kehvj2di\\osqp\\setup.py'"'"'; __file__='"'"'AppData\\Local\\Temp\\pip-install-kehvj2di\\osqp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'AppData\Local\Temp\pip-record-1u4al7gt\install-record.txt' --single-version-externally-managed --compile
cwd: AppData\Local\Temp\pip-install-kehvj2di\osqp\
-- Selecting Windows SDK version to target Windows 10.0.18362.
CMake Error at CMakeLists.txt:5 (project):
Failed to run MSBuild command:
MSBuild.exe
to get the value of VCTargetsPath:
The system cannot find the file specified
-- Configuring incomplete, errors occurred!
See also "AppData/Local/Temp/pip-install-kehvj2di/osqp/osqp_sources/build/CMakeFiles/CMakeOutput.log".
The system cannot find the file specified
CMake Error: Generator: execution of make failed. Make command was: MSBuild.exe osqpstatic.vcxproj /p:Configuration=Release /p:Platform=x64 /p:VisualStudioVersion=14.0 /v:m &&
error: [Errno 2] No such file or directory: 'osqp_sources\\build\\out\\Release\\osqp.lib'
----------------------------------------
ERROR: Command errored out with exit status 1: 'AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'Local\\Temp\\pip-install-kehvj2di\\osqp\\setup.py'"'"'; __file__='"'"'AppData\\Local\\Temp\\pip-install-kehvj2di\\osqp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'AppData\Local\Temp\pip-record-1u4al7gt\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Your problem does not seem to be the Python version, but lack of build tools. Install Microsoft Visual Build Tools and make sure they are on the PATH (so that conda can execute MSBuild.exe).
Build Tools installation instructions from cvxpy (in pptx).

Pygame not downloading on mac

When I use
pip3 install pygame
on my built in mac terminal, I expect it to return nothing or maybe something confirming the download, but instead I get
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/80/ct2vlpb17tq6fv7tk7fzrq300000gn/T/pip-install-0lflyyj6/pygame/setup.py'"'"'; __file__='"'"'/private/var/folders/80/ct2vlpb17tq6fv7tk7fzrq300000gn/T/pip-install-0lflyyj6/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/80/ct2vlpb17tq6fv7tk7fzrq300000gn/T/pip-record-riycfu31/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
That was only the error message itself, the actual output was about 400 lines long, I can post that if need be.
pygame 1.9.6 doesn't provide binary wheels for Python 3.8 for MacOS X; they provides wheels for w32/w64 and they provide wheels for MacOS X for Python 3.4-3.7.
My advice is to use Python 3.7. Python 3.8 is ok but 3rd-party modules are not yet available.

Categories