Closed jellyfishrui closed 5 years ago
@jellyfishrui can you tell me more about how you installed it? Did you create a virtual env? Can you provide the specific commands you used?
@gboeing Hi Professor Boeing, I checked this blog on your website and used the command there: https://geoffboeing.com/2017/02/python-getting-started/
I uninstalled and reinstalled all the python versions, conda and pycharm but it remained the same.
I also tried creating a virtual env in pycharm but the [WinError 193] still popped up no matter where I was trying to import osmnx: Jupyter Notebook, spyder or pycharm.
I'd recommend creating a new clean conda environment:
conda config --prepend channels conda-forge
conda create -n ox --yes python=3 osmnx jupyterlab
conda activate ox
python -c "import osmnx; print(osmnx.__version__)"
See if that runs successfully and prints out the osmnx version.
@gboeing Hi Professor Boeing, I uninstalled conda and all versions of python, and run the commands exactly following your advice. But the [WinError193] pops up again. I googled and got the answer that this is a reconciliation issue between 32 and 64.
What is weird is that I installed miniconda for win64 but the python inside is win32. Here's what I get I tried to check the python version installed from conda.
Python 3.7.1 | packaged by conda-forge | (default, Mar 13 2019, 13:32:59) [MSC v.1900 64 bit (AMD64)] :: Anaconda, Inc. on win32
But I'm using 64-bit system so I'm confused.
In that case this doesn't sound like an OSMnx issue and I'm not sure if I can help. It appears that you've installed the 32 bit version of python onto your 64 bit system (which is possible). You should install the 64 bit version.
@gboeing I uninstalled miniconda64 and tried installing conda32. It eventually worked! I cannot be grateful to all your patience! Honestly speaking, my computer science knowledge doesn't enable to fully understand the logic behind that though I roughly know it's the system reconciliation issue. Now cannot wait to explore this powerful tool! Thank you very much again!
@jellyfishrui happy to hear you got it working! Good luck.
What is weird is that I installed miniconda for win64 but the python inside is win32.
Not that sys.platform
on Windows always return win32
, even on modern 64 Windows! I know, confusing. I also do not recommend you using a miniconda for Windows 32 in a 64 machine. (And conda-forge no longer builds 32.)
My recommendation for Windows users are:
condarc
(that is opposite to what we recommend to Linux and OS X);conda-forge
.That is usually the most stable option at the moment for Windows users.
@ocefpaf Thank you very much for your reply. I tried your solution and went with miniconda 64. What's tricky that the [WinError193] pops up again. I'm 100% sure I'm using a 64-bit system.
(ox) C:\Users\jelly>python -c "import osmnx; print(osmnx.version)"
Traceback (most recent call last):
File "
And even if I go with miniconda 32, each time I restart the computer, nothing works any more. I just the only way is probably to switch to mac or linux.
I'm 100% sure I'm using a 64-bit system.
OK. In that case stick with miniconda 32, it does look like your system is not a win64.
@ocefpaf Thank you for your time. It ended up with the situation that whenever the computer restarts, nothing works no matter with 32 or 64. I think there must be something wrong when the win10 system was installed on my computer so I switched to my old laptop and it eventually worked there.
I just found a way to solve this problem without installing it on windows. Since I couldn't use Docker either on my laptop because I'm using windows family version, I eventually found Azure Notebook. Rtree must be installed first and then install osmnx via conda or pip.
!conda install osmnx -y
or
!pip install osmnx
Eventually it worked without installing anything on my laptop! Anyone with internet can use this method.
python -c "import osmnx; print(osmnx.version)"
I really works.
I have installed a clean anaonda 64-bit on my 64-bit system. Then I have executed those four lines of code and opened Jupyter notebook and it works. Great. Just need a little patience.
From what Prof. Boeing says, It is not suggested to use pip since it gave me a heavy headache.
Wow! Not sure how I got here. Not sure what just happened. Always fearful pulling strings on my newbie python sweater... AND it worked like a charm. Much gratitude and can't wait to learn and contribute (someday) to this exciting package! Many thanks for your efforts!
Issue: Cannot import osmnx after conda installation
Here's the error codes:
OSError Traceback (most recent call last)
Environment (
conda list
):Details about
conda
and system (conda info
):