Module error: Rasterio has no attribute open - python-3.x

I installed rasterio with pip install rasterio and tried running a simple command like rasterio.open(path/file) but get the following error message:
module 'rasterio' has no attribute 'open'
I tried uninstalling and reinstalling but to no avail. Does anyone know what causes this error and how to fix it?
For your information, I am running the command on Python 3.7 on a Mac.

Did you import rasterio?
e.g:
pip install rasterio
import rasterio
path = '/here/is/your/file/path.tif'
rasterio.open(path)

Related

Problems importing the oct2py python package

I have installed the oct2py package using the pip command pip install oct2py, set the environement path of python, pip and octave as in the following picture:
However, whenever I try to import it in my python script, I get the following error:
I checked whether the package is installed, it says: Requirement satisfied.
Any ideas of what I could possibly be doing wrong?

import error when trying to import tensorflow in python3

I'm getting this error when trying to import tensorflow ImportError: cannot import name 'tensorflow' from 'opt_einsum.backends' (/usr/local/lib/python3.7/site-packages/opt_einsum/backends/__init__.py).
I've installed it using pip and it's version 2.2.0.
Can someone please help me with this?
I had the same error, removing and reinstalling opt_einsum worked for me, e.g.:
pip uninstall opt_einsum
pip install opt_einsum
If this doesn't work, check if tensorflow.py is located in the /usr/local/lib/python3.7/site-packages/opt_einsum/backends/
folder

After upgrading to Anaconda 2020.02 "import pandas as pd" fails to be executed

Error Message:
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\__init__.py", line 17, in <modul> "Unable to required dependencies:\n" + "\n".join(missing_dependencies)
ImportError: Unable to import required dependencies:
numpy: DLL load failed
I did try re-installing numpy, pandas and mkl-services to no avail. Strangely, the code executes fine in Spyder, but simply won't run via "double-click" pointing towards C:\ProgramData\Anaconda3\python.exe
What am I doing wrong? Thanks!
Thanks to Yo_Chris I was able to solve my problem by de-/re-installing first pandas using pip and then doing the same for numpy.
pip uninstall pandas
pip install pandas
pip uninstall numpy
pip install numpy
As a note I did try those steps with conda before, but that did not solve the problem. I did think back then that conda and pip work the same. Apparently that is not the case.
Thanks again for letting me try pip!

Maya Error - ModuleNotFoundError: No module named 'maya.cmds'

I am using ubuntu 18.04, python 3.6.
I installed maya using :
pip install maya
then tried to run this :
import maya.cmds
then i got the module not found error.
Then i installed :
pip install maya-cmds-help
But again same error is showing.
How can i get rid of this. Any help will be greatly appreciated.
The module you install https://pypi.org/project/maya/ has nothing to do with the Autodesk Maya.

ModuleNotFoundError: No module named 'rasterio' even It is installed from the cmd

I'm using Python 3.7.2 and Pycharm as an IDE. I'm trying to import the rasterio packages but its gives me an error in Pycharm ModuleNotFoundError: No module named 'rasterio'. Even I have installed it from the cmd with the GDAL as it is mentioned here https://rasterio.readthedocs.io/en/stable/installation.html . Apparently all the packages that I want to work with has the same issue with Pycharm as even i installed them via the cmd it gives me always that error. I tried to install the rasterio package from Pycharm just as I did with Numpy but It gives me a GDAL problem. For The numpy it worked just fine. Thanks.

Resources