0

anaconda prompt

(base) C:\WINDOWS\system32>conda activate agrodss

(agrodss) C:\WINDOWS\system32>python Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.

from geocube.api.core import make_geocube import geopandas import gdal exit()

(agrodss) C:\WINDOWS\system32>python Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.

from geocube.api.core import make_geocube import geopandas

i can import the modules using anaconda prompt

but i am unable to import the same modules in the jupyter notebook

although i have added the ipykernel to newly created environment

jupyter notebook

enter image description here enter image description here enter image description here

import geopandas

import pandas


ImportError Traceback (most recent call last) in ----> 1 import geopandas 2 import pandas

~\Anaconda3\envs\agrodss\lib\site-packages\geopandas_init_.py in ----> 1 from geopandas._config import options # noqa 2 3 from geopandas.geoseries import GeoSeries # noqa 4 from geopandas.geodataframe import GeoDataFrame # noqa 5 from geopandas.array import points_from_xy # noqa

~\Anaconda3\envs\agrodss\lib\site-packages\geopandas_config.py in 124 use_pygeos = Option( 125 key="use_pygeos", --> 126 default_value=_default_use_pygeos(), 127 doc=( 128 "Whether to use PyGEOS to speed up spatial operations. The default is True "

~\Anaconda3\envs\agrodss\lib\site-packages\geopandas_config.py in _default_use_pygeos() 110 111 def _default_use_pygeos(): --> 112 import geopandas._compat as compat 113 114 return compat.USE_PYGEOS

~\Anaconda3\envs\agrodss\lib\site-packages\geopandas_compat.py in 4 import warnings 5 ----> 6 import pandas as pd 7 import shapely 8

~\Anaconda3\envs\agrodss\lib\site-packages\pandas_init_.py in 15 if missing_dependencies: 16 raise ImportError( ---> 17 "Unable to import required dependencies:\n" + "\n".join(missing_dependencies) 18 ) 19 del hard_dependencies, dependency, missing_dependencies

ImportError: Unable to import required dependencies: numpy:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.7 from "C:\Users\hp\Anaconda3\envs\agrodss\python.exe"
  • The NumPy version is: "1.19.4"

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: DLL load failed: The specified module could not be found.

4
  • Are you starting jupyter notebook from the activated env via the anaconda prompt? (base) C:\WINDOWS\system32>conda activate agrodss then (agrodss) C:\WINDOWS\system32>jupyter-notebook – user2856 Dec 4 '20 at 6:35
  • i am first activating the environment from anaconda prompt, then after opening the jupyter notebook, usually by searching in the window option, i am creating new notebook by choosing the agrodss environment, which is created at this new link/URL/webpage, localhost:8888/notebooks/Untitled9.ipynb?kernel_name=agrodss – Abhilash Singh Chauhan Dec 4 '20 at 9:25
  • In the first case you use C:\WINDOWS\system32>pythonin the second case C:\Users\hp\Anaconda3\envs\agrodss\python.exe therefore the geopandas module is well installed for the first, not for the second, with a Numpy problem – gene Dec 4 '20 at 13:22
  • I think we have to activate the newly created environment from base environment only ? Like from (base) C:\WINDOWS\system32> conda activate agrodss. Then it will activate the environment agrodss, and we will be able to execute python commands in the new environment. But it is importing the modules from anaconda prompt, but not from the Jupyter notebook. Earlier I have created the new environment from anaconda prompt, but later i have created the environment from Jupyter notebook only, it’s working now, – Abhilash Singh Chauhan Dec 6 '20 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.