Error on import when using Python 3
See original GitHub issueI installed plotnine in Python 3 using the command pip install plotnine
.
Running python -c "from plotnine import ggplot"
yields the error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/plotnine/__init__.py", line 3, in <module>
from .qplot import qplot # noqa: F401
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/plotnine/qplot.py", line 11, in <module>
from .ggplot import ggplot
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/plotnine/ggplot.py", line 17, in <module>
from .facets import facet_null
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/plotnine/facets/__init__.py", line 3, in <module>
from .facet_grid import facet_grid
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/plotnine/facets/facet_grid.py", line 10, in <module>
from .facet import facet, layout_null, combine_vars, add_missing_facets
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/plotnine/facets/facet.py", line 13, in <module>
from ..scales.scales import Scales
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/plotnine/scales/__init__.py", line 4, in <module>
from .scale_alpha import scale_alpha
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/plotnine/scales/scale_alpha.py", line 9, in <module>
from .scale import scale_discrete, scale_continuous, scale_datetime
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/plotnine/scales/scale.py", line 18, in <module>
from mizani.transforms import gettrans
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/mizani/transforms.py", line 431, in <module>
_doc='Logit Transformation')
File "/Users/dan/anaconda/envs/py35/lib/python3.5/site-packages/mizani/transforms.py", line 407, in probability_trans
raise ValueError(msg.format(distribution))
ValueError: Unknown distribution 'logistic'
It installs and loads fine from a Python 2 environment.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Python error "ImportError: No module named" - Stack Overflow
So, I set PYTHONPATH per Import statement works on PyCharm but not from terminal: export PYTHONPATH=$PYTHONPATH:`pwd` (OR your project root directory).
Read more >How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >ModuleNotFoundError: no module named Python Error [Fixed]
How to fix the ModuleNotFoundError in Python · 1. Make sure imported modules are installed · 2. Make sure modules are spelled correctly...
Read more >Python Import Error (ModuleNotFoundError) - Finxter
Python's ImportError ( ModuleNotFoundError ) indicates that you tried to import a module that Python doesn't find. It can usually be eliminated by...
Read more >Understanding the Functions of ImportError in Python - eduCBA
In Python, ImportError occurs when the Python program tries to import module which does not exist in the private table. This exception can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As far as I can tell, scipy 0.18.1 is not the problem. It may have been a case of mixed up packages.
This works for me:
Even checking the scipy code, the logistic function is present in v0.18.1 and in much older versions.
I did not set a minimum version of scipy because it has not always been easy to install on all platforms. v1.0.0 may have changed that but I am not sure if that will always be the case.
It is not necessary to chase down the root cause, unless you run into it again. Leave the PR open, I’ll look more into the availability of v1.0.0.