question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installation issue with --editable option

See original GitHub issue

Hello,

I’m trying to install pandas on Mac OS X 10.11.6 in a Django project. Pandas library is used with one of the 3rd party libraries that I am using in the project.

Since I don’t want to switch to different package manager (Anakonda) just for installing pandas (I’m using pip now), in order for me to get the C files compiled, I decided to install pandas by including --editable git+git://github.com/pydata/pandas.git@v0.18.1#egg=pandas in the requirements.txt file and the library is now installed in my src dir and there’s a symlink in my virtualenv’s site-packages which points to it.

This gets these headers compiled, but causes many strange importing errors in pandas source code itself when it is imported by a third party library that is also installed with --editable mode. F. ex. file at Users/eimantas/Desktop/Projects/WeShareSolar/mijnstroom/virtualenv/src/knmi-py/knmi/parsers.py has this line import pandas as pd. And I had to edit this code block in virtualenv/src/pandas/pandas/__init__.py for things to work:

try:
    # XXX: I had to comment this out for things to work:
    # from pandas import hashtable, tslib, lib
    import hashtable, tslib, lib
except ImportError as e:  # pragma: no cover
    module = str(e).lstrip('cannot import name ')  # hack but overkill to use re
    raise ImportError("C extension: {0} 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.".format(module))

But then another importing error appears here: virtualenv/src/pandas/pandas/core/config.py:

File "/Users/eimantas/Desktop/Projects/WeShareSolar/mijnstroom/virtualenv/src/pandas/pandas/core/config.py", line 57, in <module>
    import pandas.compat as compat
AttributeError: 'module' object has no attribute 'compat'

What should I do to get these things fixed ? I’d love to be able to use this library with pip and Django.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
jorisvandenbosschecommented, Sep 21, 2016

From the output above from testing the django app, I see you also get those warnings: RuntimeWarning: datetime.datetime size changed, may indicate binary incompatibility. Expected 64, got 48. So apparantly, some other import has adapted datetime objects. To find the culprit, you can maybe in the console import packages that are used in the django app one by one, and see when importing pandas starts failing. Googling gave me this: https://github.com/spulec/freezegun/issues/13

0reactions
Eimiscommented, Sep 21, 2016

@jorisvandenbossche thank you! Apparently freezegun is causing the problems. I’ll continue from there now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - pip install --editable cause "running develop, error in ...
The string develop in the error output points to a Development Mode of setuptools . This is because of the --editable option in...
Read more >
Cannot install into user site directory with editable source. #7953
This is a snapshot of the error. It may be that it is a deliberate design choice to disable editable installs under a...
Read more >
Pip 19.1 and installing in editable mode with pyproject.toml
Specification of editable installation. Third try on editable installs. Standardising editable mode installs (runtime layout - not hooks!)
Read more >
Local project installs - pip documentation v22.3.1
Editable installs allow you to install your project without copying any files. Instead, the files in the development directory are added to Python's...
Read more >
Troubleshoot Visual Studio installation and upgrade issues
Online installations · Step 1 - Check whether the problem is a known issue · Step 2 - Try repairing Visual Studio ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found