When I do:
import xgboost
I get no module named xgboost
I tried: pip install xgboost
and i get:
Requirement already satisfied: xgboost in e:\anaconda\lib\site-packages (1.0.2)
Requirement already satisfied: numpy in e:\anaconda\lib\site-packages (from xgboost) (1.18.1)
Requirement already satisfied: scipy in e:\anaconda\lib\site-packages (from xgboost) (1.4.1)
versions
Python 3.7.4
pip 20.0.2 from E:\Anaconda\lib\site-packages\pip (python 3.7)
Where python:
E:\Anaconda\python.exe
C:\Users\Federico\AppData\Local\Microsoft\WindowsApps\python.exe
Usually this will happen because
Based on the output of the where python
it seems like you probably used the pip
from anaconda to install the package, but are trying to import the package in a script that you're running with the python located here C:\Users\Federico\AppData\Local\Microsoft\WindowsApps\python.exe
rather than here E:\Anaconda\python.exe
If your code with the import is in a script called test.py
, for example, try running it with E:\Anaconda\python.exe test.py
and see if the error still occurs
Or start a Python shell with E:\Anaconda\python.exe
and then execute import xgboost
in the shell and see if that works
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.