简体   繁体   中英

when install OSMnx get erroe “UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 24: invalid continuation byte”

I have Python 3.6.1 32 bit, OS windows 10 x64,

Tried install

pip install OSMnx

get error

Exception: Traceback (most recent call last): File "C:\\Users\\liuzi\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\pip\\compat__init__.py", line 73, in console_to_str return s.decode(sys. stdout .encoding) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 24: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\\Users\\liuzi\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\pip\\basecommand.py", line 215, in main status = self.run(options, args) File "C:\\Users\\liuzi\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\pip\\commands\\install.py", line 324, in run requirement_set.prepare_files(finder) File "C:\\Users\\liuzi\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\pip\\req\\req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "C:\\Users\\liuzi\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\pip\\req\\req_set.py", line 634, in _prepare_file abstract_dist.prep_for_dist() File "C:\\Users\\liuzi\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\pip\\req\\req_set.py", line 129, in prep_for_dist self.req_to_install.run_egg_info() File "C:\\Users\\liuzi\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\pip\\req\\req_install.py", line 439, in run_egg_info command_desc='pytho n setup.py egg_info') File "C:\\Users\\liuzi\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\pip\\utils__init__.py", line 676, in call_subprocess line = console_to_str(proc.stdout.readline()) File "C:\\Users\\liuzi\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\pip\\compat__init__.py", line 75, in console_to_str return s.decode('utf-8') UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 24: invalid continuation byte

The OSMnx installation instructions suggest using conda-forge to install. This is particularly important on Windows, as you want to avoid compiling all the C extensions required by the geospatial dependencies.

conda install -c conda-forge osmnx

Or if all else fails, do the install in a nice clean virtual environment :

conda create --yes -c conda-forge -n OSMNX python=3 osmnx
source activate OSMNX

That should solve any Windows-related install problems (and works for Mac and Linux too).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM