When
import lmoments3 as lm
from lmoments3 import distr
I get module 'scipy.stats._continuous_distns' has no attribute 'frechet_r_gen'
I cded into scipy/stats folder, and there is no presence of 'frechet_r_gen'
I have tried pip install update scipy lmoments3 and pip install --user scipy
I am using conda environments.
https://docs.scipy.org/doc/scipy/release.1.6.0.html
This distribution was removed in scipy 1.6.0. So either install scipy 1.5.4 or make this lmoments3 module update to a more recent scipy version.
Related
I am relatively new to python and trying to install geopandas on python 3.7 using pip. For separate reasons, I would like to avoid using the anaconda distribution. Following this post, I was able to successfully install geopandas by first installing the dependencies manually. The problem is that now I run into a problem when I try to import geopandas:
import geopandas
The subsequent error message is:
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\geopandas\__init__.py", line 5, in <module>
from geopandas.io.file import read_file
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\geopandas\io\file.py", line 4, in <module>
import fiona
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\fiona\__init__.py", line 87, in <module>
from fiona.collection import BytesCollection, Collection
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\fiona\collection.py", line 9, in <module>
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: DLL load failed: The specified module could not be found.
Any advice would be greatly appreciated
My case is similar to yours. And here is how I got mine setup:
Platform: Windows 10, 64-bit Python Version: Python 3.7
Dependencies (whl files needed):
GDAL‑3.0.4‑cp37‑cp37m‑win_amd64.whl
Fiona‑1.8.13‑cp37‑cp37m‑win_amd64.whl
pyproj‑2.6.0‑cp37‑cp37m‑win_amd64.whl
Rtree‑0.9.4‑cp37‑cp37m‑win_amd64.whl
Steps:
Download the files that match the platform and Python version from
https://www.lfd.uci.edu/~gohlke/pythonlibs/
Install packages (stick with the order)
a) C:\Users...\Python37\Scripts>pip3.7 install C:...\GDAL‑3.0.4‑cp37‑cp37m‑win_amd64.whl
b) C:\Users...\Python37\Scripts>pip3.7 install C:...\Fiona‑1.8.13‑cp37‑cp37m‑win_amd64.whl
c) C:\Users...\Python37\Scripts>pip3.7 install C:...\pyproj‑2.6.0‑cp37‑cp37m‑win_amd64.whl
d) C:\Users...\Python37\Scripts>pip3.7 install C:...\Rtree‑0.9.4‑cp37‑cp37m‑win_amd64.whl
Given no errros, now it's good to go:
C:\Users...\Python37\Scripts>pip3.7.exe install geopandas
Test it using IDEL 3.7.4
import geopandas as pdg
(It works!)
This works for me and I hope this is also helpful for you.
I had trouble installing geopandas on (win-64, Spyder3.8, Python3.8.3)
Use this expression to install geopandas in anaconda prompt:
conda install -c conda-forge/label/cf202003 geos
(do not use this website: https://geopandas.org/install.html)
(do not use this expression: conda install --channel conda-forge geopandas)
The simplest method to install geopandas is:
conda install geopandas
In order to update geopandas to latest version use the following command after installation by conda:
pip install geopandas --upgrade
There are other installation methods also explained in Geopandas official website.
Conda is really powerful when it comes to installation as it will install the dependencies needed by the package. However, if you would like to install dependencies earlier than use the following command:
conda install pandas fiona shapely pyproj rtree descartes
Note that if you have installed the dependencies using above command then you can also use pip to install geopandas but before installing via pip dependencies are required to be installed. In order to read more about dependencies, please follow the official guide. To install using pip use the following command:
pip install geopandas
I've been faced to Module Not Found Error in a script which all it's requirements has been installed. I'm trying to import spatial library:
import spatial
This library is located here:
C:\Users\ASUS\AppData\Local\Programs\Python\Python37\Lib\site-packages\scipy\spatial
I checked installed packages through pip list and it was okay. I tried to install spatial-lib in Pycharm project environment but it couldn't be done:
Could not find a version that satisfies the requirement spatial-lib (from versions: )
No matching distribution found for spatial-lib
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
It's nonesence, because my pip is up-to-date. Maybe good to say, importing scipy has such probelms too.
It looks like spatial is a sub-package of scipy. Therefore, to import spatial, you should use the following:
from scipy import spatial
I am importing train_test_split as:
from sklearn.model_selection import train_test_split and it is giving an error cannot import name 'comb'.
The versions I am using are scipy 0.18.1 and sklearn 0.17.1
Below is the detail of error, please guide here if you feel something is wrong.
Traceback (most recent call last):
File "<ipython-input-21-e45e815fd516>", line 1, in <module>
from sklearn import model_selection
File "C:\Users\rahulsharma53\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\model_selection\__init__.py", line 1, in <module>
from ._split import BaseCrossValidator
File "C:\Users\rahulsharma53\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\model_selection\_split.py", line 31, in <module>
from ..utils.fixes import signature, comb
ImportError: cannot import name 'comb
The suggestion in the comment above worked for me.
scikit-learn version 0.17.1 doesn't have the 'model-selection' module (it has instead the 'cross_validation' module, reference here). Since you have Anaconda installed, trying to upgrade scikit-learn to the newest version using the pip installer may cause a mismatch with the installed scipy and numpy versions (upgrading them with the pip installer wont solve the problem). The solution is to upgrade all three libraries using anaconda's installer, but before that all existing versions must be uninstalled, first using pip (in case, like me, you already went the pip route) then using conda.
Following the suggestions in the referred link:
pip uninstall:
pip uninstall numpy scipy -y
pip uninstall scikit-learn -y
conda uninstall:
conda uninstall numpy scipy scikit-learn -y
conda install:
conda install numpy scipy scikit-learn -y
Don't forget to restart Anaconda before retrying your import clause.
I have installed QuTip at my CentOS 6.5.
Now I try to run this code
http://nbviewer.jupyter.org/github/jrjohansson/wavefunction/blob/master/Wavefunction-Phase-Qubit-Current-Biased.ipynb
I copy the above codes
from scipy import *
from scipy import optimize
from wavefunction import *
from wavefunction.wavefunction1d import *
....
but have some error when running
ImportError: No module named 'wavefunction'
Then I use
conda install wavefunction
pip install wavefunction
still don't work
No matching distribution found for wavefunction
Package not found
Please help me to resolve this issue about the install of the python 'wavefunction' package
Seems like he hasnt uploaded it to conda or pypi. In such cases, you can install it with git:
pip install git+https://github.com/jrjohansson/wavefunction.git#egg=wavefunction
I'm trying to run a Python package called D3E for single-cell differential gene expression. I have Python 2.7.5 on Fedora 20. I just installed the SciPy package using the instructions here:
sudo yum install numpy scipy python-matplotlib ipython python-pandas sympy python-nose
However, when I try to run the script, I keep getting a SciPy error:
bash-4.2$ python D3ECmd.py ~/Documents/geneExpressionTable.txt ~/outputFile.txt cellType1 cellTYpe2 -n=0, -z=1
Traceback (most recent call last):
File "D3ECmd.py", line 34, in <module>
from D3EUtil import readData, getParamsBayesian, getParamsMoments, cramerVonMises, logStatus, goodnessOfFit, distributionTest
File "/home/user/Software/D3E/D3EUtil.py", line 36, in <module>
from scipy.stats import gmean, ks_2samp, anderson_ksamp
ImportError: cannot import name anderson_ksamp
What would you recommend I try to fix this error?
Thanks.
As #Warren pointed out, anderson_ksamp is not available in scipy version .12.1. It is a relatively new addition to scipy.
I'm not a fedora user. That said, it sounds like installing scipy using pip is your best bet.
Step one: install dependencies. Check Muneeb's answer for information on how to install blas and lapack on fedora. It should be as simple as:
sudo yum install lapack lapack-devel blas blas-devel
Step two: install scipy using pip.
sudo pip install --upgrade scipy
This process will take a long time. Get lunch. You should have a working copy of scipy when you get back.
Note, if you don't have pip, run the following command:
sudo yum install python-pip