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.

PyPi package fails to install and run

See original GitHub issue

Creating a python 3.6.0 virtual environment and running pip install causallib succeeds, but then trying to import any modules fails. E.g. from causallib.estimation import IPW:

...

~/.pyenv/versions/3.6.0/envs/venv360/lib/python3.6/site-packages/pandas/core/frame.py in <module>
     86 from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin as DatetimeLikeArray
     87 from pandas.core.arrays.sparse import SparseFrameAccessor
---> 88 from pandas.core.generic import NDFrame, _shared_docs
     89 from pandas.core.index import (
     90     Index,

~/.pyenv/versions/3.6.0/envs/venv360/lib/python3.6/site-packages/pandas/core/generic.py in <module>
     69 from pandas.core.ops import _align_method_FRAME
     70 
---> 71 from pandas.io.formats.format import DataFrameFormatter, format_percentiles
     72 from pandas.io.formats.printing import pprint_thing
     73 from pandas.tseries.frequencies import to_offset

~/.pyenv/versions/3.6.0/envs/venv360/lib/python3.6/site-packages/pandas/io/formats/format.py in <module>
     45 from pandas.core.indexes.datetimes import DatetimeIndex
     46 
---> 47 from pandas.io.common import _expand_user, _stringify_path
     48 from pandas.io.formats.printing import adjoin, justify, pprint_thing
     49 

~/.pyenv/versions/3.6.0/envs/venv360/lib/python3.6/site-packages/pandas/io/common.py in <module>
      7 from http.client import HTTPException  # noqa
      8 from io import BytesIO
----> 9 import lzma
     10 import mmap
     11 import os

~/.pyenv/versions/3.6.0/lib/python3.6/lzma.py in <module>
     25 import io
     26 import os
---> 27 from _lzma import *
     28 from _lzma import _encode_filter_properties, _decode_filter_properties
     29 import _compression

ModuleNotFoundError: No module named '_lzma'

It looks like there are versioning issues with pandas.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
Salompascommented, Aug 19, 2019

Depending on how Python is installed in your system, the module lzma will not be available (I first found this after installing Python with pyenv on MacOS). This is due to a lack of the appropriate dependencies when compiling Python. Since pandas uses that module, you end up with the No module found error message. On release 0.25.1 of pandas the issue will be fixed. If your Python is not properly installed (i.e. lzma not available) you will get a warning message when importing pandas, but pandas will be imported. However, calling any function that requires compression via lzma will still fail.

1reaction
ehudkrcommented, Aug 20, 2019

Thanks for contributing your bug-fix, @Salompas. @BoltzmannBrain, feel free to update if this fixes that for you. Unless you or anyone else objects, I think we can close this issue, as it is not directly causallib related.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't I install packages from PyPI with Pip? - Stack Overflow
When Pip only finds a "source package" on PyPI, and that source package contains native code, it tries to compile it, i.e. build...
Read more >
Troubleshooting PyPI package installation | Cloud Composer
Locate the pip error in Cloud Build logs · In Google Cloud console, go to the Build history page. Go to Build history...
Read more >
Cannot Download Packages from the PyPi Server
The local PyPi Server failed to run or stopped running. ... not have online access, make sure all required packages are installed on...
Read more >
How to install modules with PIP (and fix it when it fails) - Medium
Assuming that, the first thing to do is to check if the module exists. The main way to do this is to go...
Read more >
Packages installed from PyPI cannot depend on packages ...
I'm getting this error when I try to install a package I have released to PyPI ... and use --index-url to override pypi.org...
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