我需要安装robotframework-autoitlibrary以用于我的测试用例。 我的问题是当我尝试通过命令行使用以下命令安装AutoIt Library时:
pip install -U robotframework-autoitlibrary --no-cache-dir --pre
我遇到此错误:
C:\windows\system32>pip install -U robotframework-autoitlibrary --no-cache-
dir --pre
Collecting robotframework-autoitlibrary
Downloading
https://files.pythonhosted.org/packages/4e/a4/9e51fe35b1da7a006b773c9c234f78e89bcc4f267152c4e9fa8260631fa8/robotframework-autoitlibrary-1.2.2.zip (701kB)
100% |################################| 706kB 1.6MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\user-a~1\appdata\local\temp\pip-install-
oro1ov\robotframework-autoitlibrary\setup.py", line 93, in <module>
destPath = os.path.normpath(os.path.join(os.getenv("HOMEDRIVE"),
r"\RobotFramework\Extensions\AutoItLibrary"))
File "c:\python27\lib\ntpath.py", line 65, in join
result_drive, result_path = splitdrive(path)
File "c:\python27\lib\ntpath.py", line 115, in splitdrive
if len(p) > 1:
TypeError: object of type 'NoneType' has no len()
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
c:\users\user-a~1\appdata\local\temp\pip-install-oro1ov\robotframework-
autoitlibrary\
我当前安装的python软件包及其版本为:
Pillow==5.3.0
Pygments==2.3.1
pypiwin32==223
Pypubsub==4.0.0
pywin32==224
robotframework==3.1
robotframework-ride==1.5.2.1
robotframework-selenium2library==3.0.0
robotframework-seleniumlibrary==3.3.0
selenium==3.141.0
six==1.12.0
typing==3.6.6
urllib3==1.24.1
wxPython==4.0.3
我已经尝试过以下命令:
pip install --upgrade setuptools
当输入回声%HOMEDRIVE%时,输出为:
C:\Users\cmpeixoto>echo %HOMEDRIVE%
C:
感谢您的帮助,
答案 0 :(得分:3)
该错误看起来好像没有设置环境变量HOMEDRIVE
,即使它具有根据您的测试得出的值(库安装程序使用它来复制某些文件)。
您可以尝试-手动设置它,然后在同一命令提示符(cmd)会话中立即运行pip
-
set HOMEDRIVE=C:
pip install -U robotframework-autoitlibrary --no-cache-dir --pre