0

I'm currently working in a conda environment and I have a directory named "mypackage" containing four files:

1. mod1.py
   def f1(a: int):
       return a + 1

2. mod2.py
   from mod1 import f1
   def f2(a: int):
       b = f1(a)
       return b + 1

3. __init__.py
   # This file is empty

4. setup.py
   from setuptools import setup, find_packages
   setup(
       name='mypackage',
       version='1.0.0',
       description='A description of mypackage',
       packages=find_packages(),
       author='My Name',
       author_email='my.email@example.com',
   )

I would like to be able to import my modules from any directory on my PC without modifying sys.path. Is it possible to install my package locally on my PC?

I have reviewed several links (Installing specific package version with pip) but they are too advanced for me.

Luis
  • 71
  • 5
  • Within that conda env, you should be able to access `mypackage` after you install it. What is the specific question? – doneforaiur Jul 02 '23 at 20:27

1 Answers1

0

You can install a package in editable mode using the -e parameter. This allows you to make changes to the package and see the impact without having to update it.

for example you can do this

pip install -e PATH_OF_YOUR_PACKAGE
Aazerra
  • 161
  • 9
  • I get an error "ERROR: No .egg-info directory found in C:\Users\user1\AppData\Local\Temp\pip-pip-egg-info-ro1cchb5" – Luis Jul 03 '23 at 12:19