asdfを介したPythonのインストール:pipインストールで要件が満たされていると表示されても、scrapyパッケージが見つかりません。

asdfを介したPythonのインストール:pipインストールで要件が満たされていると表示されても、scrapyパッケージが見つかりません。

私はArch Linuxを実行しており、パッケージを更新しました。

私は持っていますasdfランタイムやSDKなどを管理します。

私のプロジェクトルートには次の.tool-versionsファイルがあります。

~/code/bejebeje-bot main !1 ?1 ❯ \cat .tool-versions                                                                                                                                                                       3.10.2
python 3.10.2

それから私はやったasdf reshim python。その後、scrapyPythonパッケージをインストールしようとし、次pipのような結果が得られました。

~/code/bejebeje-bot main !1 ?1 ❯ pip install scrapy                                                                                                                                                                        3.10.2
Requirement already satisfied: scrapy in /home/j/.local/lib/python3.10/site-packages (2.6.1)
Requirement already satisfied: pyOpenSSL>=16.2.0 in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from scrapy) (22.0.0)
Requirement already satisfied: cryptography>=2.0 in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from scrapy) (36.0.1)
Requirement already satisfied: protego>=0.1.15 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (0.2.1)
Requirement already satisfied: w3lib>=1.17.0 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (1.22.0)
Requirement already satisfied: itemloaders>=1.0.1 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (1.0.4)
Requirement already satisfied: zope.interface>=4.1.3 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (5.4.0)
Requirement already satisfied: setuptools in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from scrapy) (58.1.0)
Requirement already satisfied: service-identity>=16.0.0 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (21.1.0)
Requirement already satisfied: cssselect>=0.9.1 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (1.1.0)
Requirement already satisfied: lxml>=3.5.0 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (4.8.0)
Requirement already satisfied: PyDispatcher>=2.0.5 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (2.0.5)
Requirement already satisfied: itemadapter>=0.1.0 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (0.4.0)
Requirement already satisfied: tldextract in /home/j/.local/lib/python3.10/site-packages (from scrapy) (3.2.0)
Requirement already satisfied: queuelib>=1.4.2 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (1.6.2)
Requirement already satisfied: Twisted>=17.9.0 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (22.2.0)
Requirement already satisfied: parsel>=1.5.0 in /home/j/.local/lib/python3.10/site-packages (from scrapy) (1.6.0)
Requirement already satisfied: cffi>=1.12 in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from cryptography>=2.0->scrapy) (1.15.0)
Requirement already satisfied: jmespath>=0.9.5 in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from itemloaders>=1.0.1->scrapy) (0.10.0)
Requirement already satisfied: six>=1.6.0 in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from parsel>=1.5.0->scrapy) (1.16.0)
Requirement already satisfied: pyasn1-modules in /home/j/.local/lib/python3.10/site-packages (from service-identity>=16.0.0->scrapy) (0.2.8)
Requirement already satisfied: pyasn1 in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from service-identity>=16.0.0->scrapy) (0.4.8)
Requirement already satisfied: attrs>=19.1.0 in /home/j/.local/lib/python3.10/site-packages (from service-identity>=16.0.0->scrapy) (21.4.0)
Requirement already satisfied: Automat>=0.8.0 in /home/j/.local/lib/python3.10/site-packages (from Twisted>=17.9.0->scrapy) (20.2.0)
Requirement already satisfied: typing-extensions>=3.6.5 in /home/j/.local/lib/python3.10/site-packages (from Twisted>=17.9.0->scrapy) (4.1.1)
Requirement already satisfied: incremental>=21.3.0 in /home/j/.local/lib/python3.10/site-packages (from Twisted>=17.9.0->scrapy) (21.3.0)
Requirement already satisfied: constantly>=15.1 in /home/j/.local/lib/python3.10/site-packages (from Twisted>=17.9.0->scrapy) (15.1.0)
Requirement already satisfied: hyperlink>=17.1.1 in /home/j/.local/lib/python3.10/site-packages (from Twisted>=17.9.0->scrapy) (21.0.0)
Requirement already satisfied: requests>=2.1.0 in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from tldextract->scrapy) (2.27.1)
Requirement already satisfied: idna in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from tldextract->scrapy) (3.3)
Requirement already satisfied: requests-file>=1.4 in /home/j/.local/lib/python3.10/site-packages (from tldextract->scrapy) (1.5.1)
Requirement already satisfied: filelock>=3.0.8 in /home/j/.local/lib/python3.10/site-packages (from tldextract->scrapy) (3.6.0)
Requirement already satisfied: pycparser in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from cffi>=1.12->cryptography>=2.0->scrapy) (2.21)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from requests>=2.1.0->tldextract->scrapy) (1.26.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from requests>=2.1.0->tldextract->scrapy) (2.0.12)
Requirement already satisfied: certifi>=2017.4.17 in /home/j/.asdf/installs/python/3.10.2/lib/python3.10/site-packages (from requests>=2.1.0->tldextract->scrapy) (2021.10.8)

実行してみると実際に存在するpip listものが見られますよScrapy

~/code/bejebeje-bot main !1 ?1 ❯ pip list                                                                                                                                                                                  3.10.2
Package            Version
------------------ ---------
attrs              21.4.0
Automat            20.2.0
certifi            2021.10.8
cffi               1.15.0
charset-normalizer 2.0.12
constantly         15.1.0
cryptography       36.0.1
cssselect          1.1.0
filelock           3.6.0
hyperlink          21.0.0
idna               3.3
incremental        21.3.0
itemadapter        0.4.0
itemloaders        1.0.4
jmespath           0.10.0
lxml               4.8.0
parsel             1.6.0
pip                22.0.4
pipx               1.0.0
Protego            0.2.1
pyasn1             0.4.8
pyasn1-modules     0.2.8
pycparser          2.21
PyDispatcher       2.0.5
pyOpenSSL          22.0.0
queuelib           1.6.2
requests           2.27.1
requests-file      1.5.1
Scrapy             2.6.1
service-identity   21.1.0
setuptools         58.1.0
six                1.16.0
tldextract         3.2.0
Twisted            22.2.0
typing_extensions  4.1.1
urllib3            1.26.8
userpath           1.7.0
w3lib              1.22.0
zope.interface     5.4.0

ただし、scrapyコマンドが認識されずにスパイダーを実行しようとすると、次の結果が表示されます。

~/code/bejebeje-bot/gsscraper main !1 ?1 ❯ scrapy crawl gsspider -o stran.json                                                                                                                                             3.10.2
zsh: command not found: scrapy

私が実行すると、asdf current次のようになります。

~/code/bejebeje-bot main !1 ?1 ❯ asdf current                                                                                                                                                                              3.10.2
nodejs          ______          No version is set. Run "asdf <global|shell|local> nodejs <version>"
python          3.10.2          /home/j/code/bejebeje-bot/.tool-versions

私がここで何を間違っているのか?なぜ私は走ることができないのですかscrapy?混乱しています。

PS。タグを追加したいのですがasdfポイントが足りません。

修正する

私は走り、pip show scrapy次を得た:

~/code/bejebeje-bot main !1 ?1 ❯ pip show scrapy                                                                                                                                                                           3.10.2
Name: Scrapy
Version: 2.6.1
Summary: A high-level Web Crawling and Web Scraping framework
Home-page: https://scrapy.org
Author: Scrapy developers
Author-email: 
License: BSD
Location: /home/j/.local/lib/python3.10/site-packages
Requires: cryptography, cssselect, itemadapter, itemloaders, lxml, parsel, protego, PyDispatcher, pyOpenSSL, queuelib, service-identity, setuptools, tldextract, Twisted, w3lib, zope.interface
Required-by: 

私の考えでは、この場所は私の下のどこかにあるべきだと思います/home/j/.asdf/shims/!鉱山には$PATH以下があります。

~/code/bejebeje-bot main !1 ?1 ❯ sed 's/:/\n/g' <<< "$PATH"                                                                                                                                                                3.10.2
/home/j/.asdf/shims
/opt/asdf-vm/bin
/usr/local/sbin
/usr/local/bin
/usr/bin
/usr/local/go/bin
/home/j/code/go/bin
/home/j/.dotnet/tools
/usr/lib/jvm/default/bin
/usr/bin/site_perl
/usr/bin/vendor_perl
/usr/bin/core_perl
/usr/local/go/bin
/home/j/code/go/bin
/usr/local/go/bin
/home/j/code/go/bin
/home/j/.dotnet
/home/j/.dotnet/tools
~/programs/JetBrains Rider-2021.3.3/bin

ベストアンサー1

おすすめ記事