Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems installing pandas using pip #13095

Closed
lherstix opened this issue May 5, 2016 · 12 comments
Closed

Problems installing pandas using pip #13095

lherstix opened this issue May 5, 2016 · 12 comments
Labels
Build Library building on various platforms

Comments

@lherstix
Copy link

lherstix commented May 5, 2016

Hey everyone,

I installed pandas via pip git

pip install git+git://github.com/pydata/pandas.git

and during the installation it says:

Running setup.py install for pandas ... done Successfully installed pandas-0.18.0+207.gc6110e2

But when I want to import it, it gives an error

C extension: hashtable not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first.

I already tried to run this but the response is always:

python: can't open file 'setup.py': [Errno 2] No such file or directory

Maybe I am in the wrong directory. So in which I am suppose to run it?
Also I looked in site-packages but can't find pandas or something similar.

I am confused since it said it runs the setup.py during the installation...

Can anyone help? What I am doing wrong?

Thanks in advance

Leni

@jreback
Copy link
Contributor

jreback commented May 5, 2016

are you trying to contribute? you need to git clone, see here

otherwise see installation instructions here

generally a pip install pandas (or much better is simply to use conda).

I think that pip doesn't install the deps correctly if you are installing like this (and that its failing because you don't have the build deps installed, e.g. cython/numpy).

@jreback jreback added the Build Library building on various platforms label May 5, 2016
@max-sixty
Copy link
Contributor

@jreback
Copy link
Contributor

jreback commented May 5, 2016

@MaximilianR that's a good point. do you want to PR for an extended message?

@lherstix
Copy link
Author

lherstix commented May 5, 2016

I tried conda before but it is the same problem with importing. So I tried it in an new created environment and without. Installing seems to be always fine. Just importing is the same problem always

adding -force doesn't help since it can't find setup.py at all such that it still gives the error

@lherstix
Copy link
Author

lherstix commented May 5, 2016

so I found now the pandas in

/anaconda/lib/python2.7/site-packages

but still can't find any setup.py

@jreback
Copy link
Contributor

jreback commented May 5, 2016

once you install via anaconda you don't need to do anything else.

conda create -n test pandas
source activate test
python -c 'import pandas; print(pandas.__version__)'

@lherstix
Copy link
Author

lherstix commented May 5, 2016

Great it worked, except form another name of the environment I don't what I did different last time. However, it worked! So thanks a lot!!! :)
Could just explain me why do I need this environment?

@jreback
Copy link
Contributor

jreback commented May 5, 2016

@lherstix you don't :> that was just a test the -n <name_of_environment> can be anything. its up to you (and you can have multiple ones). http://conda.pydata.org/docs/

@lherstix
Copy link
Author

lherstix commented May 5, 2016

Thanks a lot, that helped :)

@lherstix
Copy link
Author

Me again...

So after pandas worked fine, I installed seaborn the same way and in the same environment. Now I get an error for pandas and for seaborn when I import them:
import pandas as pd
import seaborn as sns
I get the following error:

Traceback (most recent call last): File "test1.py", line 1, in <module> import pandas as pd File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/pandas/__init__.py", line 39, in <module> from pandas.core.api import * File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/pandas/core/api.py", line 10, in <module> from pandas.core.groupby import Grouper File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/pandas/core/groupby.py", line 18, in <module> from pandas.core.frame import DataFrame File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/pandas/core/frame.py", line 39, in <module> from pandas.core.series import Series File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/pandas/core/series.py", line 2944, in <module> import pandas.tools.plotting as _gfx # noqa File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/pandas/tools/plotting.py", line 27, in <module> import pandas.tseries.converter as conv File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/pandas/tseries/converter.py", line 7, in <module> import matplotlib.units as units File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/matplotlib/__init__.py", line 1131, in <module> rcParams = rc_params() File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/matplotlib/__init__.py", line 975, in rc_params return rc_params_from_file(fname, fail_on_error) File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/matplotlib/__init__.py", line 1100, in rc_params_from_file config_from_file = _rc_params_in_file(fname, fail_on_error) File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file with _open_file_or_url(fname) as fd: File "/Users/lena/anaconda/envs/test/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url encoding = locale.getdefaultlocale()[1] File "/Users/lena/anaconda/envs/test/lib/python2.7/locale.py", line 543, in getdefaultlocale return _parse_localename(localename) File "/Users/lena/anaconda/envs/test/lib/python2.7/locale.py", line 475, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8

If I comment out import pandas as pd, I get:

Traceback (most recent call last): File "test1.py", line 9, in <module> import seaborn as sns File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/seaborn/__init__.py", line 1, in <module> from .rcmod import * File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/seaborn/rcmod.py", line 6, in <module> import matplotlib as mpl File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/matplotlib/__init__.py", line 1131, in <module> rcParams = rc_params() File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/matplotlib/__init__.py", line 975, in rc_params return rc_params_from_file(fname, fail_on_error) File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/matplotlib/__init__.py", line 1100, in rc_params_from_file config_from_file = _rc_params_in_file(fname, fail_on_error) File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file with _open_file_or_url(fname) as fd: File "/Users/lena/anaconda/envs/test/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/Users/lena/anaconda/envs/test/lib/python2.7/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url encoding = locale.getdefaultlocale()[1] File "/Users/lena/anaconda/envs/test/lib/python2.7/locale.py", line 543, in getdefaultlocale return _parse_localename(localename) File "/Users/lena/anaconda/envs/test/lib/python2.7/locale.py", line 475, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8

I hope it is understandable and you can help me! Greatz!

@jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche added this to the No action milestone May 10, 2016
@lherstix
Copy link
Author

lherstix commented May 11, 2016

Yes yuo were right. and it works! Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants