需要帮助使用pip安装特定的python软件包 [英] Need help installing a specific python package using pip
问题描述
我已经看到与该问题相关的问题,但是这些答案对我而言并不起作用.我正在尝试安装xgboost软件包,但出现此错误:
I have seen related questions to my question, but those answers didn't work for me. I am trying to install xgboost package, but I got this error:
*No files/directories in C:\Users\Fatemeh\AppData\Local\Temp\pip-build-57cpr7io\xgboost\pip-egg-info (from PKG-INFO)*
我尝试了几乎所有选项,例如-no-cache-dir ,-no-clean ,但是遇到了相同的错误.
I have tried almost all the options such as --no-cache-dir, --no-clean but got the same error.
如果您能帮助我解决此问题,我将不胜感激.我尝试从Github安装并尝试了其他方法(使用cmd和setup.py脚本),但是他们没有安装整个程序包,某些xgboost命令无法正常工作.
I would appreciate it if you can help me fix this. I tried installing from Github and tried other methods (using cmd and setup.py scripts), but they didn't install the whole package and some of xgboost commands were not working.
使用pip安装其他软件包没有任何问题,xgboost是我安装它时遇到的唯一问题.
I don't have any problem with installing other packages using pip, xgboost is the only one I have problem with installing it.
以下是我使用的脚本以及获得的输出(我从所有链接中删除了https://):
Here are the scripts that I used accompanied with the output that I got (I have deleted the https:// from all the links):
C:\Users\Fatemeh\PycharmProjects\AHW1AI>**pip install xgboost**
Collecting xgboost
Using cached xgboost-0.4a30.tar.gz
**No files/directories in C:\Users\Fatemeh\AppData\Local\Temp\pip-build-57cpr7io\xgboost\pip-egg-info (from PKG-INFO)**
------------------------------------------------------------------
C:\Users\Fatemeh\PycharmProjects\AHW1AI>**pip install -v xgboost**
Collecting xgboost
1 location(s) to search for versions of xgboost:
* pypi.python.org/simple/xgboost/
Getting page pypi.python.org/simple/xgboost/
Looking up "pypi.python.org/simple/xgboost/" in the cache
Current age based on date: 206
Freshness lifetime from max-age: 600
Freshness lifetime from request max-age: 600
The response is "fresh", returning cached response
600 > 206
Analyzing links from page pypi.python.org/simple/xgboost/
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a12.tar.gz#md5=4d768e034a28590497bb79279f036946 (from pypi.python.org/simple/xgboost/), version: 0.4
a12
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a13.tar.gz#md5=5f53d51e4305c679192b3cabda2b0dbe (from pypi.python.org/simple/xgboost/), version: 0.4
a13
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a14.tar.gz#md5=a7c648933a47ae31f869b5c030c17c69 (from pypi.python.org/simple/xgboost/), version: 0.4
a14
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a15.tar.gz#md5=bcab760af5ac7f20e88bde7426423565 (from pypi.python.org/simple/xgboost/), version: 0.4
a15
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a18.tar.gz#md5=9f70ca05843afb1d50522530f140d640 (from pypi.python.org/simple/xgboost/), version: 0.4
a18
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a19.tar.gz#md5=413d55d0534447e77064dbd1ad1ccb48 (from pypi.python.org/simple/xgboost/), version: 0.4
a19
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a20.tar.gz#md5=88721733e7c7026fa2e95de7165d4b86 (from pypi.python.org/simple/xgboost/), version: 0.4
a20
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a21.tar.gz#md5=45284beb53f5087e73dcf55ff1c5a026 (from pypi.python.org/simple/xgboost/), version: 0.4
a21
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a22.tar.gz#md5=cb858cf85fe9f4263e9b523c4900c3f9 (from pypi.python.org/simple/xgboost/), version: 0.4
a22
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a23.tar.gz#md5=4f8a17ca86995ed51fc1a424618b94db (from pypi.python.org/simple/xgboost/), version: 0.4
a23
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a24.tar.gz#md5=2bf0edfe62ddb3502c4f48df3428a7e0 (from pypi.python.org/simple/xgboost/), version: 0.4
a24
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a25.tar.gz#md5=bf3d633fa88ae7923794dd5da0600388 (from pypi.python.org/simple/xgboost/), version: 0.4
a25
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a26.tar.gz#md5=e5b1f7c477e5238e7b491153449b33b2 (from pypi.python.org/simple/xgboost/), version: 0.4
a26
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a27.tar.gz#md5=cd091569f651c3c625c4a299cfc72e74 (from pypi.python.org/simple/xgboost/), version: 0.4
a27
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a28.tar.gz#md5=fd8ffedd172b5cb917483df76e6efe7a (from pypi.python.org/simple/xgboost/), version: 0.4
a28
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a29.tar.gz#md5=4bf4eb1898cfc28bbd3b43e19c69fdf5 (from pypi.python.org/simple/xgboost/), version: 0.4
a29
Found link pypi.python.org/packages/source/x/xgboost/xgboost-0.4a30.tar.gz#md5=5f4e812ba3a1faa85514993e56c1b4b8 (from pypi.python.org/simple/xgboost/), version: 0.4
a30
Using version 0.4a30 (newest of versions: 0.4a12, 0.4a13, 0.4a14, 0.4a15, 0.4a18, 0.4a19, 0.4a20, 0.4a21, 0.4a22, 0.4a23, 0.4a24, 0.4a25, 0.4a26, 0.4a27, 0.4a28, 0.4a29, 0.4a30)
Looking up "https://pypi.python.org/packages/source/x/xgboost/xgboost-0.4a30.tar.gz" in the cache
Current age based on date: 714911
Freshness lifetime from max-age: 31557600
The response is "fresh", returning cached response
31557600 > 714911
Using cached xgboost-0.4a30.tar.gz
Downloading from URL
pypi.python.org/packages/source/x/xgboost/xgboost-0.4a30.tar.gz#md5=5f4e812ba3a1faa85514993e56c1b4b8 (from pypi.python.org/simple/xgboost/)
Running setup.py (path:C:\Users\Fatemeh\AppData\Local\Temp\pip-build-502i197j\xgboost\setup.py) egg_info for package xgboost
Running command python setup.py egg_info
**Cleaning up...
No files/directories in C:\Users\Fatemeh\AppData\Local\Temp\pip-build-502i197j\xgboost\pip-egg-info (from PKG-INFO)**
Exception information:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\pip\basecommand.py", line 209, in main
status = self.run(options, args)
File "C:\Anaconda3\lib\site-packages\pip\commands\install.py", line 310, in run
wb.build(autobuilding=True)
File "C:\Anaconda3\lib\site-packages\pip\wheel.py", line 747, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 359, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 590, in _prepare_file
abstract_dist.prep_for_dist()
File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 127, in prep_for_dist
self.req_to_install.run_egg_info()
File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 457, in run_egg_info
metadata_name = canonicalize_name(self.pkg_info()["Name"])
File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 535, in pkg_info
data = self.egg_info_data('PKG-INFO')
File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 473, in egg_info_data
filename = self.egg_info_path(filename)
File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 517, in egg_info_path
'No files/directories in %s (from %s)' % (base, filename)
pip.exceptions.InstallationError: **No files/directories in** **C:\Users\Fatemeh\AppData\Local\Temp\pip-build-502i197j\xgboost\pip-egg-info (from PKG-INFO)**
推荐答案
我认为它将起作用
-
首先从给定的链接中下载Wheel文件 xgboost 0.90
然后通过键入以下命令从downloads文件夹安装该库
Then install this library from downloads folder by typing the following command
python -m pip install downloads/package-name.whl
将程序包名称替换为wheel文件名
这篇关于需要帮助使用pip安装特定的python软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!