I am studying a book called head first python on my own.
There was an error in the process of making a self-made module using pip, and I would like you to tell me how to resolve it (policy).
I would like to use setuptoolls to create a state where I can quote functions from site-packages.
Step 1: Create distribution description
Step 2: Create distribution file
Step 3: Install the distribution file (This is where I get an error and stumble)
"The following error in ""actual action"" にて"
"WARNING: The directory '/Users/sugimotoyuki/Library/Caches/pipe' or its parent directory is not owned or is not written by the current user.The cache has been disabled.Check the permissions and owner of that directory.If you do not want to study.
WARNING: Requirement 'vsearch-1.0.tar.gz' looks like a filename, but the file does not exist
Processing./vsearch-1.0.tar.gz
ERROR: Could not install packages due to an EnvironmentError: [Errno2] No such file or directory: '/Users/sugimotoyuki/PycharmProjects/mymodules/vsearch-1.0.tar.gz'
Step 1:
(1)Create vsearch (2) setup.py and (3)README.txt (blank)
(1) vsearch
def search4 letters (phrase:str, letters:str='aeiou') ->set:
'Return a set of the 'letters' found in 'phrase'.'
return set(letters).intersection(set(phrase))
(2) setup.py
from setup tools import setup
setup(
name = 'vsearch',
version = '1.0',
description='The Head First Python Search Tools',
author = 'HF Python 2e',
author_email='[email protected]',
url='headfirstlabs.com',
py_modules=['vsearch'],
)
Step 2:
Perform the following in the terminal under the project in Step 1
(base)sugimotoyuki @sugimotoyukinoMacBook-Air-2 mymodules%python3 setup.py sdist
running sdist
running egg_info
writing vsearch.egg-info/PKG-INFO
writing dependency_links to vsearch.egg-info/dependency_links.txt
writing top-level names to vsearch.egg-info/top_level.txt
reading manifest file 'vsearch.egg-info/SOURCES.txt'
writing manifest file 'vsearch.egg-info/SOURCES.txt'
running check
creating vsearch-1.0
creating vsearch-1.0/vsearch.egg-info
copying files to vsearch-1.0...
copying README.txt->vsearch-1.0
copying setup.py ->vsearch-1.0
copying vsearch.py ->vsearch-1.0
copying vsearch.eg-info/PKG-INFO->vsearch-1.0/vsearch.eg-info
copying vsearch.eg-info/SOURCES.txt->vsearch-1.0/vsearch.eg-info
copying vsearch.egg-info/dependency_links.txt->vsearch-1.0/vsearch.egg-info
copying vsearch.egg-info/top_level.txt->vsearch-1.0/vsearch.egg-info
Writing vsearch-1.0/setup.cfg
Creating target
removing 'vsearch-1.0' (and everything under it)
Step 3:
under the dist file environment generated by Step 2
Do the following within the terminal → Error
(base)sugimotoyuki @sugimotoyukinoMacBook-Air-2 mymodules%sudo python3-mpip install vsearch-1.0.tar.gz
Password:
WARNING: The directory '/Users/sugimotoyuki/Library/Caches/pipe' or its parent directory is not acknowledged or is not written by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with so, you're waiting.
WARNING: Requirement 'vsearch-1.0.tar.gz' looks like a filename, but the file does not exist
Processing./vsearch-1.0.tar.gz
ERROR: Could not install packages due to an EnvironmentError: [Errno2] No such file or directory: '/Users/sugimotoyuki/PycharmProjects/mymodules/vsearch-1.0.tar.gz'
tar
is located below the ./dist
directory (It's written in a confusing place), so
sudo python 3-mpip install dist/vsearch-1.0.tar.gz
will be .If there is an error,
sudo python 3-mp pip install wheel
Then run it!
© 2024 OneMinuteCode. All rights reserved.