Regarding the cause of the error during the final distribution file installation when creating the self-made module using pip.

Asked 2 years ago, Updated 2 years ago, 49 views

Contents of consultation

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).

What do you want to do

I would like to use setuptoolls to create a state where I can quote functions from site-packages.

What was done

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)

Status

"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'

Details

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'

Enter a description of the image here

Enter a description of the image here

python python3

2022-09-30 19:21

1 Answers

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!


2022-09-30 19:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.