conda-forge / osmnx-feedstock

A conda-smithy repository for osmnx.
BSD 3-Clause "New" or "Revised" License
8 stars 10 forks source link

Trouble importing osmnx on Windows 10 using anaconda #74

Closed marnagy closed 3 years ago

marnagy commented 3 years ago

Issue: I am trying installing osmnx module according to documentation on readthedocs. After creating new enviroment, conda list osmnx shows installed module osmnx, but if I run python and try import osmnx, the response is Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'osmnx'
Also(in python REPL), if I print out all modules (help() + modules), osmnx is NOT there. Sorry for the formatting of outputs below, I am new to markdown. Versions: osmnx 0.16.2 Python 3.9.1 conda 4.9.1 Environment (conda list):

``` ### Name Version Build Channel attrs 20.3.0 pyhd3deb0d_0 conda-forge boost-cpp 1.74.0 h54f0996_1 conda-forge branca 0.4.1 py_0 conda-forge brotlipy 0.7.0 py39ha3862ff_1001 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge ca-certificates 2020.12.5 h5b45459_0 conda-forge cairo 1.16.0 hd28d34b_1006 conda-forge certifi 2020.12.5 py39hcbf5309_0 conda-forge cffi 1.14.4 py39h0878f49_1 conda-forge cfitsio 3.470 h0af3d06_7 conda-forge chardet 4.0.0 py39hcbf5309_0 conda-forge click 7.1.2 pyh9f0ad1d_0 conda-forge click-plugins 1.1.1 py_0 conda-forge cligj 0.7.1 pyhd8ed1ab_0 conda-forge cryptography 3.3.1 py39h0878f49_0 conda-forge curl 7.71.1 h4b64cdc_8 conda-forge cycler 0.10.0 py_2 conda-forge decorator 4.4.2 py_0 conda-forge descartes 1.1.0 py_4 conda-forge expat 2.2.9 h33f27b4_2 conda-forge fiona 1.8.18 py39he2373ac_0 conda-forge folium 0.11.0 py_0 conda-forge freetype 2.10.4 h546665d_0 conda-forge freexl 1.0.5 hd288d7e_1002 conda-forge gdal 3.1.4 py39hda8168b_0 conda-forge geopandas 0.8.1 py_0 conda-forge geos 3.8.1 he025d50_0 conda-forge geotiff 1.6.0 h8884d1a_3 conda-forge gettext 0.19.8.1 h1a89ca6_1005 conda-forge glib 2.66.4 he2d232f_1 conda-forge hdf4 4.2.13 h0e5069d_1004 conda-forge hdf5 1.10.6 nompi_h5268f04_1112 conda-forge icu 67.1 h33f27b4_0 conda-forge idna 2.10 pyh9f0ad1d_0 conda-forge intel-openmp 2020.3 h57928b3_311 conda-forge jinja2 2.11.2 pyh9f0ad1d_0 conda-forge joblib 1.0.0 pyhd8ed1ab_0 conda-forge jpeg 9d h8ffe710_0 conda-forge kealib 1.4.14 ha3510f1_0 conda-forge kiwisolver 1.3.1 py39h2e07f2f_0 conda-forge krb5 1.17.2 hbae68bd_0 conda-forge libblas 3.8.0 21_mkl conda-forge libcblas 3.8.0 21_mkl conda-forge libcurl 7.71.1 h4b64cdc_8 conda-forge libffi 3.3 h0e60522_2 conda-forge libgdal 3.1.4 h0e5aa5a_0 conda-forge libglib 2.66.4 h5320221_1 conda-forge libiconv 1.16 he774522_0 conda-forge libkml 1.3.0 he9e54da_1012 conda-forge liblapack 3.8.0 21_mkl conda-forge libnetcdf 4.7.4 nompi_h3a9aa94_107 conda-forge libpng 1.6.37 h1d00b33_2 conda-forge libpq 12.3 h4f54205_3 conda-forge libspatialindex 1.9.3 he025d50_3 conda-forge libspatialite 5.0.0 hf693123_0 conda-forge libssh2 1.9.0 hb06d900_5 conda-forge libtiff 4.2.0 hc10be44_0 conda-forge libwebp-base 1.1.0 h8ffe710_3 conda-forge libxml2 2.9.10 hf5bbc77_3 conda-forge lz4-c 1.9.2 h62dcd97_2 conda-forge m2w64-gcc-libgfortran 5.3.0 6 conda-forge m2w64-gcc-libs 5.3.0 7 conda-forge m2w64-gcc-libs-core 5.3.0 7 conda-forge m2w64-gmp 6.1.0 2 conda-forge m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge markupsafe 1.1.1 py39ha3862ff_2 conda-forge matplotlib-base 3.3.3 py39h581301d_0 conda-forge mkl 2020.4 hb70f87d_311 conda-forge msys2-conda-epoch 20160418 1 conda-forge munch 2.5.0 py_0 conda-forge networkx 2.5 py_0 conda-forge numpy 1.19.4 py39h6635163_1 conda-forge olefile 0.46 pyh9f0ad1d_1 conda-forge openjpeg 2.3.1 h48faf41_3 conda-forge openssl 1.1.1i h8ffe710_0 conda-forge osmnx 0.16.2 pyhd3deb0d_0 conda-forge pandas 1.1.5 py39h2e25243_0 conda-forge pcre 8.44 ha925a31_0 conda-forge pillow 8.0.1 py39hbc3ea3a_0 conda-forge pip 20.3.3 pyhd8ed1ab_0 conda-forge pixman 0.40.0 h8ffe710_0 conda-forge poppler 0.89.0 h5d62644_1 conda-forge poppler-data 0.4.10 0 conda-forge postgresql 12.3 h0f1a9bc_3 conda-forge proj 7.1.1 h7d85306_3 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyproj 2.6.1.post1 py39hd2b018c_3 conda-forge pysocks 1.7.1 py39h467e6f4_2 conda-forge python 3.9.1 h7840368_2_cpython conda-forge python-dateutil 2.8.1 py_0 conda-forge python_abi 3.9 1_cp39 conda-forge pytz 2020.5 pyhd8ed1ab_0 conda-forge requests 2.25.1 pyhd3deb0d_0 conda-forge rtree 0.9.7 py39h09fdee3_0 conda-forge scikit-learn 0.24.0 py39he931e04_0 conda-forge scipy 1.5.3 py39hc0c34ad_0 conda-forge setuptools 49.6.0 py39h467e6f4_2 conda-forge shapely 1.7.1 py39hdfdf89f_1 conda-forge six 1.15.0 pyh9f0ad1d_0 conda-forge sqlite 3.34.0 h8ffe710_0 conda-forge threadpoolctl 2.1.0 pyh5ca1d4c_0 conda-forge tiledb 2.1.3 h968eb34_0 conda-forge tk 8.6.10 h8ffe710_1 conda-forge tornado 6.1 py39hb82d6ee_0 conda-forge tzdata 2020d h516909a_0 conda-forge urllib3 1.26.2 pyhd8ed1ab_0 conda-forge vc 14.2 hb210afc_2 conda-forge vs2015_runtime 14.28.29325 h5e1d092_0 conda-forge wheel 0.36.2 pyhd3deb0d_0 conda-forge win_inet_pton 1.1.0 py39hde42818_1 conda-forge wincertstore 0.2 py39hde42818_1005 conda-forge xerces-c 3.2.3 ha925a31_1 conda-forge xz 5.2.5 h62dcd97_1 conda-forge zlib 1.2.11 h62dcd97_1010 conda-forge zstd 1.4.5 h1f3a1b7_2 conda-forge ```


Details about conda and system ( conda info ):

``` active environment : geo active env location : C:\Users\mnagy\anaconda3\envs\geo shell level : 2 user config file : C:\Users\mnagy\.condarc populated config files : C:\Users\mnagy\.condarc conda version : 4.9.2 conda-build version : 3.20.5 python version : 3.8.5.final.0 virtual packages : __cuda=11.2=0 __win=0=0 __archspec=1=x86_64 base environment : C:\Users\mnagy\anaconda3 (writable) channel URLs : https://conda.anaconda.org/conda-forge/win-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : C:\Users\mnagy\anaconda3\pkgs C:\Users\mnagy\.conda\pkgs C:\Users\mnagy\AppData\Local\conda\conda\pkgs envs directories : C:\Users\mnagy\anaconda3\envs C:\Users\mnagy\.conda\envs C:\Users\mnagy\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.5 Windows/10 Windows/10.0.19041 administrator : False netrc file : None offline mode : False ```
ocefpaf commented 3 years ago

Please open the AnacondaPrompt on Windows and ype:

where python

and paste the results here.

marnagy commented 3 years ago

Result of where python: C:\Users\mnagy\anaconda3\envs\ox\python.exe C:\Users\mnagy\AppData\Local\Microsoft\WindowsApps\python.exe

ocefpaf commented 3 years ago

You have two python installations, a system one and the one inside the environment. I'm assuming you activate the environment, which seems to be named ox, with:

conda activate ox

right? If not can you try to activate it first and then importing it?

PS: I usually do not recommend more than 1 python installation to avoid such problems. Do you need the system one? If not I would remove it.

marnagy commented 3 years ago

I have activated the enviroment, yes. The python.exe file in WindowsApps directory, is empty. After removing it, it shows only one installation, but the error remains.

ocefpaf commented 3 years ago

That is quite odd :-/

I'm not a Windows expert. My only other recommendation is to remove the anaconda distribution and re-try with miniconda. It is usually lighter and works out of the box.

marnagy commented 3 years ago

Okay, thank you anyway. I will try miniconda and edit this after. Edit: I tried it with miniconda, but got same result.

marnagy commented 3 years ago

I have had issue with conda installation, not OSMNX module. Sorry.