Anaconda Scipy shift import issues even though Scipy is installed - scipy

----> 7 from scipy.ndimage.interpolation import shift
ModuleNotFoundError: No module named 'scipy.ndimage.interpolation'
It gives me this error even though Numpy and Scipy are all installed.
I perused this site and other online forums and for the life of me I cannot find the solution to this problem.
Thank You.

Related

Cannot import torch module despite installing Pytorch

For some reason, I cannot import torch with my Python scripts despite already downloading the necessary software (my version of Python is 3.8).
I have researched this problem online, including similar questions on this forum, and have followed the suggestions delineated in this guide: https://blog.finxter.com/python-modulenotfounderror-no-module-named-torch/
However, none of them work, and thus I'm completely stumped. Could anyone be kind enough to advise on what's causing this error?

Jupyter cant run shapely.geometry

Hey so I've managed to get shapely.geometry to run just fine on PyCharm.
But the difficulty here is in getting the import to run on Jupyter notebook.
I have done:
import geopandas as gpd
This returns shapely.geometry doesn't exist.
I think I know how to fix this through downloading the file
"Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl" and doing conda install (that)... but it returned that the channel didnt exist...
So I did:
conda install --add channels https://www.lfd.uci.edu/~gohlke/pythonlibs/
(which is where I got the file from) which worked just fine so I then again did "conda install Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl" but it returned:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://www.lfd.uci.edu/~gohlke/pythonlibs/win-64/repodata.json>
A simple retry will get you on your way...
Tried that, didnt work. Someone please help. Reminder that I successfully installed shapely with all of its modules working through "pip install Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl" WITHIN Pycharm itself.
EDIT 1
Im following the textbook "Mastering Geospatial Anlsysis with Python" It got me to download the packages:
gdal
geos
shapely
fiona
pyshp
pyproj
rasterio
geopandas
EDIT 2
I dont know what i did but somehow i fixed it... but the thing is, i literally did nothing except take out a shapely file with a long name and kept the one just called "shapely".
If i have files like this
gdal-2.2.2-py36hcebd033_1
instead of this
gdal
Is that the problem?????? because if it is, then i dont know how to get files like that they just either appear or they dont.
Shapely is a wrapper of C++ library called GEOS that is not installed with the wheel. You should go to the page and install that library.
Or perhaps you have Pycharm for python 2 and Jupyter for python 3 (or vice-versa).
Running conda install -c conda-forge geos=3.7.1 worked for me.

ImportError: No module named sympy

I am getting the following error while trying to run a sympy file in order to contribute to sympy. It is :
ImportError: No module named sympy
I installed the sympy module through pip for both python2.7 and python 3.
Also, isympy is working.
Strangly, when I try to import sympy in python's interactive console in the main sympy directory, no import errors are shown but in some other directory, it shows import errors.
Please help me to download the sympy module in a way that I will be able to run the code.
Thanks.
Importing module in python console of main directory.
Importing module in some other directory.
A likely cause here is that you are using two different Pythons. If you have Python installed multiple times (like Python 2 and Python 3), each has its own separate packages. You can check what Python you are using by printing sys.executable.
I should point out that for the purposes of contributing to SymPy, you generally want to run against the development version. That is, running Python from the SymPy directory and importing the development version from there, without actually installing it.
Thanks for the reply.
But I solved the problem. I realised that I didn't install sympy in the current conda environment. When I tried it using the command:
conda install sympy
It worked and no error is being shown.
Thanks.

What is the structure of import function in Python?

I am searching to do a little programm with 3D animations for one homework for my school.
I work in Spyder space from Anaconda(Python) .
I want to import for that the module vpython installed by pip.
The first line of the function " from visual import * " doesn't work whereas in all examples found on the web, all the programms begins by this line for calling the whole function of this module. Also, i have seen different path and files "vpython" installes on my PC in the path Anaconda3.
So, for me, python don't arrive to find the good path with "import".
Have I to uninstall and install again Python and Anaconda or this is just a problem of grammary from me on my programm and i must help the function import to find the good path, writing some new instructions?
Thanks to have read and i wish you have one idea of what is wrong in this because for the moment I'm blocked.
In Jupyter/iPython/Anaconda, the import should be
from vpython import *
In classic VPython, it's
from visual import *

Is Pandas included in EPD Free

The enthought site says pandas is included but I've installed on both windows and Linux and doing a 'import pandas' gives a "ImportError: No module named pandas found". Is pandas included with EPD Free 7.3?
Update :
Ok think I was slightly misled by the EPD Free download page which says that EPD includes pandas but if you go to the detailed list of libraries pandas is not included
EPD Free 7.3 installer did not ship with Pandas, and hence the import error. But, if you have a registered EPD Free account, you can use enpkg to install pandas. Look at this support page for more info.