安装Scrapy中报错
最后 pip install pyOpenSSL 和pipinstall scrapy的时候,老是报错,有什么解决方法,谢谢大神C:\Users\17447>pip install pyOpenSSL
Downloading/unpacking pyOpenSSL
Downloading/unpacking cryptography>=35.0 (from pyOpenSSL)
pip can't proceed with requirement 'cryptography>=35.0 (from pyOpenSSL)' due to a pre-existing build directory.
location: c:\users\17447\appdata\local\temp\pip_build_17447\cryptography
This is likely due to a previous installation that failed.
pip is being responsible and not assuming it can delete this.
Please delete it and try again.
Storing debug log for failure in C:\Users\17447\pip\pip.log
C:\Users\17447>pip install pyOpenSSL
Downloading/unpacking pyOpenSSL
Downloading/unpacking cryptography>=35.0 (from pyOpenSSL)
Running setup.py (path:c:\users\17447\appdata\local\temp\pip_build_17447\cryptography\setup.py) egg_info for package cryptography
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\17447\appdata\local\temp\pip_build_17447\cryptography\setup.py", line 87
print(f" Python: {'.'.join(str(v) for v in sys.version_info[:3])}")
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\17447\appdata\local\temp\pip_build_17447\cryptography\setup.py", line 87
print(f" Python: {'.'.join(str(v) for v in sys.version_info[:3])}")
^
SyntaxError: invalid syntax
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in c:\users\17447\appdata\local\temp\pip_build_17447\cryptography
Storing debug log for failure in C:\Users\17447\pip\pip.log
C:\Users\17447>pip install Scrapy
Downloading/unpacking Scrapy
Downloading/unpacking lxml>=3.5.0 (from Scrapy)
Running setup.py (path:c:\users\17447\appdata\local\temp\pip_build_17447\lxml\setup.py) egg_info for package lxml
Building lxml version 4.9.1.
Building without Cython.
Building against pre-built libxml2 andl libxslt libraries
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'project_urls'
warnings.warn(msg)
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
warning: no previously-included files found matching '*.py'
Downloading/unpacking Twisted>=17.9.0 (from Scrapy)
Running setup.py (path:c:\users\17447\appdata\local\temp\pip_build_17447\Twisted\setup.py) egg_info for package Twisted
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\17447\appdata\local\temp\pip_build_17447\Twisted\setup.py", line 10, in <module>
import pathlib
ImportError: No module named pathlib
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\17447\appdata\local\temp\pip_build_17447\Twisted\setup.py", line 10, in <module>
import pathlib
ImportError: No module named pathlib
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in c:\users\17447\appdata\local\temp\pip_build_17447\Twisted
Storing debug log for failure in C:\Users\17447\pip\pip.log
C:\>pip install pathlib
小凯2013 发表于 2022-9-18 13:10
C:\Users\17447>pip install pathlib
Requirement already satisfied (use --upgrade to upgrade): pathlib in c:\python27\lib\site-packages
Cleaning up...
C:\Users\17447>pip install pyOpenSSL
Downloading/unpacking pyOpenSSL
Downloading/unpacking cryptography>=35.0 (from pyOpenSSL)
Running setup.py (path:c:\users\17447\appdata\local\temp\pip_build_17447\cryptography\setup.py) egg_info for package cryptography
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\17447\appdata\local\temp\pip_build_17447\cryptography\setup.py", line 87
print(f" Python: {'.'.join(str(v) for v in sys.version_info[:3])}")
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\17447\appdata\local\temp\pip_build_17447\cryptography\setup.py", line 87
print(f" Python: {'.'.join(str(v) for v in sys.version_info[:3])}")
^
SyntaxError: invalid syntax
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in c:\users\17447\appdata\local\temp\pip_build_17447\cryptography
Storing debug log for failure in C:\Users\17447\pip\pip.log
你的命令我试了一下,但是安装pyOpenSSL 还是这个错误,我的系统是win10 haitianodd 发表于 2022-9-18 14:19
C:%users\17447>pip install pathlib
Requirement already satisfied (use --upgrade to upgrade): path ...
C:\>pip list
看一下有没有pyOpenSSL,有的话就说明安装成功。 小凯2013 发表于 2022-9-18 14:36
C:\>pip list
看一下有没有pyOpenSSL,有的话就说明安装成功。
C:\Users\17447>pip list
lxml (3.4.2)
pathlib (1.0.1)
pip (1.5.6)
pywin32 (219)
setuptools (7.0)
没有大神 等一会,我去玩会~(我是小孩子) 小凯2013 发表于 2022-9-18 14:55
等一会,我去玩会~(我是小孩子)
6666。回来记得帮我看问题
是不是之前你安装过Python后来卸载了,然后又安装了别的版本到同一个位置?或者没有正常卸载? hrpzcf 发表于 2022-9-18 15:16
是不是之前你安装过Python后来卸载了,然后又安装了别的版本到同一个位置?或者没有正常卸载?
安装卸妆好几遍了,但是这个版本只安装到这个位置了,应该没有冲突,我本来的python版本是3.9 ,这个是为了按照小甲鱼的按照步骤来安装的,版本是2.7.5 能删除的东西我都删除了 haitianodd 发表于 2022-9-18 15:54
安装卸妆好几遍了,但是这个版本只安装到这个位置了,应该没有冲突,我本来的python版本是3.9 ,这个是为 ...
旧版应该是没卸载干净,到程序卸载里看看有没有旧版没卸载的,卸载了,再把原来的安装路径、帖子里报错指示的路径删除干净,删除旧版的环境变量,安装新版本 新版教程步骤:
1、下载Miniconda
https://conda.io/minconda.html
下载对应的版本即可。
2、傻瓜式安装。
3、打开Anaconda Prompt,输入conda install -c conda-forge scrapy即可。(记得装回Python3) 小凯2013 发表于 2022-9-18 16:10
新版教程步骤:
1、下载Miniconda
https://conda.io/minconda.html
谢谢 我试试 或下载我这个,放在C:\Users\你的用户名\目录下,解压,再执行pip install scrapy
(我发不了,>30MB)
或者说安装一个Python3.10.7(按你的系统没问题)
为了帮你,我的Python3.10.7都重装了一遍,555~ 正在下载小甲鱼的Python教程...
Windows PowerShell
版权所有(C) Microsoft Corporation。保留所有权利。
安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows
PS C:\Users\Administrator> you-get "https://www.bilibili.com/video/BV1c4411e77t?spm_id_from=333.337.search-card.all.click"
you-get: This is a multipart video. (use --playlist to download all parts.)
site: Bilibili
title: 【Python教程】《零基础入门学习Python》最新版(2022年09月16日更新) (P1. 序章)
stream:
- format: flv
container: flv
quality: 高清 1080P
size: 31.5 MiB (33018152 bytes)
# download-with: you-get --format=flv
Downloading 【Python教程】《零基础入门学习Python》最新版(2022年09月16日更新) (P1. 序章).flv ...
100% ( 31.5/ 31.5MB) ├████████████████████████████████████████┤205 kB/s
Downloading 【Python教程】《零基础入门学习Python》最新版(2022年09月16日更新) (P1. 序章).cmt.xml ... 下载这个很简单,pip install you-get就行了 小凯2013 发表于 2022-9-18 17:33
或下载我这个,放在C:%users\你的用户名\目录下,解压,再执行pip install scrapy
(我发不了,>30MB)
昨天给你的那个网址我打开不了呢,昨天下午五点睡。一睡睡到现在 小凯2013 发表于 2022-9-18 17:37
或者说安装一个Python3.10.7(按你的系统没问题)
辛苦你了 hrpzcf 发表于 2022-9-18 16:06
旧版应该是没卸载干净,到程序卸载里看看有没有旧版没卸载的,卸载了,再把原来的安装路径、帖子里报错指 ...
目录和注册表 里面有的文件我都删除了,还是一样的错误,我装个新版好了,不折腾了,辛苦你大神
页:
[1]
2