PS C:UsersSaksham KaseraDesktopdata structure> py -m pip install --user folium
Traceback (most recent call last):
File "C:UsersSaksham KaseraAppDataLocalProgramsPythonPython37librunpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "C:UsersSaksham KaseraAppDataLocalProgramsPythonPython37librunpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "C:UsersSaksham KaseraAppDataLocalProgramsPythonPython37librunpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "C:UsersSaksham KaseraAppDataLocalProgramsPythonPython37libsite-packagespip__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ValueError: source code string cannot contain null bytes
这是依赖性问题。尝试删除并重新安装库。建议使用不同的python环境进行安装,或使用miniconda进行数据分析库和工具。它解决了许多依赖性问题。步骤如下:
-
安装miniconda。
-
使用命令创建环境
conda create -n testenv python=2.7
- 始终在使用
activate testenv
之前激活环境 - 使用
conda install pandas
安装panda和所有需要的库
尽情享受熊猫!