import pandas
Although it seems like a typing issue pandas is still affected, error:
root@ae9a5374fe6d:/buildbot# python -c "import pandas"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/pandas/__init__.py", line 55, in <module>
from pandas.core.api import (
File "/usr/local/lib/python3.5/dist-packages/pandas/core/api.py", line 5, in <module>
from pandas.core.arrays.integer import (
File "/usr/local/lib/python3.5/dist-packages/pandas/core/arrays/__init__.py", line 1, in <module>
from .array_ import array # noqa: F401
File "/usr/local/lib/python3.5/dist-packages/pandas/core/arrays/array_.py", line 7, in <module>
from pandas.core.dtypes.common import (
File "/usr/local/lib/python3.5/dist-packages/pandas/core/dtypes/common.py", line 11, in <module>
from pandas.core.dtypes.dtypes import (
File "/usr/local/lib/python3.5/dist-packages/pandas/core/dtypes/dtypes.py", line 53, in <module>
class Registry:
File "/usr/local/lib/python3.5/dist-packages/pandas/core/dtypes/dtypes.py", line 84, in Registry
self, dtype: Union[Type[ExtensionDtype], str]
File "/usr/lib/python3.5/typing.py", line 552, in __getitem__
dict(self.__dict__), parameters, _root=True)
File "/usr/lib/python3.5/typing.py", line 512, in __new__
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/python3.5/typing.py", line 512, in <genexpr>
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/python3.5/typing.py", line 1077, in __subclasscheck__
if super().__subclasscheck__(cls):
File "/usr/lib/python3.5/abc.py", line 225, in __subclasscheck__
for scls in cls.__subclasses__():
TypeError: descriptor '__subclasses__' of 'type' object needs an argument
To reproduce:
$ docker pull ursalab/amd64-ubuntu-16.04-python-3:worker
$ docker run -it ursalab/amd64-ubuntu-16.04-python-3:worker bash
# python -c "import pandas"
pip freeze | grep pandas
pandas==0.25.0
3.5.3 is the minimum on 0.25; see the release notes
@jreback Thanks! May I suggest to update the documentation about that https://pandas.pydata.org/pandas-docs/stable/install.html#python-version-support ?
yes that needs updating (and removing the 2.7)
@kszucs how is pandas being installed? (I don't directly find this profile in the configuration)
As normally this should be catched during installation (see discussion i https://github.com/pandas-dev/pandas/pull/27288)
@jorisvandenbossche
FROM ubuntu:16.04
RUN apt-get update -y && \
apt-get install -y python3 python3-pip
RUN pip3 install pandas
CMD python3 -c "import pandas"
$ docker build -t pandas-py35 -f <the-dockerfile-above> .
$ docker run pandas-py35
@kszucs that had a warning for me locally
Step 3/4 : RUN pip3 install pandas
---> Running in 2181656518ff
Collecting pandas
Downloading https://files.pythonhosted.org/packages/a7/d9/e03b615e973c2733ff8fd53d95bd3633ecbfa81b5af2f83fe39647c02344/pandas-0.25.0-cp35-cp35m-manylinux1_x86_64.whl (10.3MB)
Collecting python-dateutil>=2.6.1 (from pandas)
Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
Collecting numpy>=1.13.3 (from pandas)
Downloading https://files.pythonhosted.org/packages/69/25/eef8d362bd216b11e7d005331a3cca3d19b0aa57569bde680070109b745c/numpy-1.17.0-cp35-cp35m-manylinux1_x86_64.whl (20.2MB)
Collecting pytz>=2017.2 (from pandas)
Downloading https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl (510kB)
Collecting six>=1.5 (from python-dateutil>=2.6.1->pandas)
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, numpy, pytz, pandas
Successfully installed numpy-1.17.0 pandas-0.25.0 python-dateutil-2.8.0 pytz-2019.1 six-1.12.0
You are using pip version 8.1.1, however version 19.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
I suspect that with a newer version of pip (RUN pip3 install -U pip setuptools
), the build would error.
Probably.
The python3 version in Ubuntu Xenial repos is 3.5.1. This breaks a lot of stuff for a lot of people. Not sure if that means anything to y'all, but I thought you might like to know.
@csbrown that should be fine. You'll just pull in pandas 0.24.x when you install. Does that not happen?
it pulls pandas 0.25 for me. I pip3 install pandas==0.23
and it works fine.
Just doing a pip3 install pandas
and trying to import pandas
is what landed me here looking for what went wrong :)
What version of pip?
On Wed, Aug 14, 2019 at 11:34 AM Scott Brown notifications@github.com
wrote:
it pulls pandas 0.25 for me. I pip3 install pandas==0.23 and it works
fine.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pandas-dev/pandas/issues/27558?email_source=notifications&email_token=AAKAOIWR5X45TOF3JYPRQRTQEQX3FA5CNFSM4IGONSN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4JLYVA#issuecomment-521321556,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKAOIXG3VFDNKVTGLX6LM3QEQX3FANCNFSM4IGONSNQ
.
scott@gpu-001:~$ sudo apt-get install --only-upgrade python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (8.1.1-2ubuntu0.4).
0 upgraded, 0 newly installed, 0 to remove and 280 not upgraded.
Gotcha. That pip may not support python_requires, which is what is supposed
to get you the right version for your python.
You'll need to upgrade pip or pin pandas.
On Wed, Aug 14, 2019 at 11:37 AM Scott Brown notifications@github.com
wrote:
scott@gpu-001:~$ sudo apt-get install --only-upgrade python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (8.1.1-2ubuntu0.4).
0 upgraded, 0 newly installed, 0 to remove and 280 not upgraded.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pandas-dev/pandas/issues/27558?email_source=notifications&email_token=AAKAOIR626JIAGAVX75OCPTQEQYEVA5CNFSM4IGONSN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4JL7QA#issuecomment-521322432,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKAOIVDEHEWSOUJZW7AKWDQEQYEVANCNFSM4IGONSNQ
.
The workaround is just fine for me. Maybe this info will help someone else though.
If you are using python 3.5.2, using pandas version 0.24.2 works
pip3 uninstall pandas
pip3 install pandas==0.24.2
If you are using python 3.5.2, using pandas version 0.24.2 works
pip3 uninstall pandas
pip3 install pandas==0.24.2
It works. Thanks.
I have same issue here in pandas-dev virtual environment. My Python version is 3.8.2.
I'm following the instructions in this link:
https://pandas.pydata.org/docs/dev/development/contributing.html#creating-a-development-environment
python setup.py build_ext --inplace -j 4
throws an error:
C:\Users\Phuong\Anaconda3\envs\pandas-dev\include /Tcpandas/_libs/src/ujson/python/ujson.c /Fobuild\temp.win-amd64-3.8\Release\pandas/_libs/src/ujson/python/ujson.obj -D_GNU_SOURCE
error: command 'cl.exe' failed: No such file or directory
I tried: pip install pandas
, it works perfectly fine. But import pandas
in Python interpreter throws an error:
```Traceback (most recent call last):
File "C:UsersPhuongDocumentsGITpandaspandas__init__.py", line 32, in
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
File "C:UsersPhuongDocumentsGITpandaspandas_libs__init__.py", line 13, in
from pandas._libs.interval import Interval
ModuleNotFoundError: No module named 'pandas._libs.interval'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "
File "C:UsersPhuongDocumentsGITpandaspandas__init__.py", line 36, in
raise ImportError(
ImportError: C extension: No module named 'pandas._libs.interval' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
```
Note that in my base environment, pandas installation and import both work fine.
Do you have any idea how to fix this? Thanks.
@ngthianhphuong https://pandas.pydata.org/docs/dev/development/contributing.html#creating-a-development-environment has the instructions for building pandas from source to contribute to pandas. Are you intending to contribute to pandas? If so, you'll need to install a C compiler to avoid that error: https://pandas.pydata.org/docs/dev/development/contributing.html#installing-a-c-compiler
If not, then I'd recommend just sticking to pip
or conda
to install pandas.
Make sure you don't have a folder named pandas
where you start your interpreter.
Hi @TomAugspurger, thanks for your prompt reply. Yep that's right, I'd like to contribute so want to check first how it works.
The instructions says Build Tools for Visual Studio 2019 is required, which was already installed. I am now on Creating a Python environment step.
The command python setup.py build_ext --inplace -j 4
must be run in pandas directory, am I right?
Yes, that's correct.
command 'cl.exe' failed: No such file or directory
That indicates you don't have the compiler on your terminals path. It's been a while since I've used windows, but IIRC there's a special command prompt application launcher that sets everything up for you.
Most helpful comment
it pulls pandas 0.25 for me. I
pip3 install pandas==0.23
and it works fine.