0

When I ran pip install . -vvv | findstr 'adding' on my package and tried to import it I received a ModuleNotFoundError. looking into it, I can only find the mypackage-1.0.0.dist-info folder in Python/Python311/Lib/site-packages. However, weirdly enough, all the files are downloaded into build/lib at the relative location of where I ran the pip install command.

Output for pip install . -vvv | findstr 'adding':

Running command pip subprocess to install build dependencies
  Using pip 23.1.2 from C:\Users\HIDDENUSER\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip (python 3.11)
  Collecting setuptools>=43.0.0
    Using cached setuptools-68.0.0-py3-none-any.whl (804 kB)
  Collecting wheel
    Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
  Installing collected packages: wheel, setuptools
    Creating C:\Users\HIDDENUSER\AppData\Local\Temp\pip-build-env-ks52g_5g\overlay\Scripts
  Successfully installed setuptools-68.0.0 wheel-0.40.0
  Running command Getting requirements to build wheel
  C:\Users\HIDDENUSER\AppData\Local\Temp\pip-build-env-ks52g_5g\overlay\Lib\site-packages\setuptools\config\pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
    config = read_configuration(filepath, True, ignore_option_errors, dist)
  running egg_info
  writing mypackage.egg-info\PKG-INFO
  writing dependency_links to mypackage.egg-info\dependency_links.txt
  writing entry points to mypackage.egg-info\entry_points.txt
  writing requirements to mypackage.egg-info\requires.txt
  writing top-level names to mypackage.egg-info\top_level.txt
  reading manifest file 'mypackage.egg-info\SOURCES.txt'
  adding license file 'LICENSE'
  writing manifest file 'mypackage.egg-info\SOURCES.txt'
  Running command Preparing metadata (pyproject.toml)
  C:\Users\HIDDENUSER\AppData\Local\Temp\pip-build-env-ks52g_5g\overlay\Lib\site-packages\setuptools\config\pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
    config = read_configuration(filepath, True, ignore_option_errors, dist)
  running dist_info
  creating C:\Users\HIDDENUSER\AppData\Local\Temp\pip-modern-metadata-4cevnuh2\mypackage.egg-info
  writing C:\Users\HIDDENUSER\AppData\Local\Temp\pip-modern-metadata-4cevnuh2\mypackage.egg-info\PKG-INFO
  writing dependency_links to C:\Users\HIDDENUSER\AppData\Local\Temp\pip-modern-metadata-4cevnuh2\mypackage.egg-info\dependency_links.txt
  writing entry points to C:\Users\HIDDENUSER\AppData\Local\Temp\pip-modern-metadata-4cevnuh2\mypackage.egg-info\entry_points.txt
  writing requirements to C:\Users\HIDDENUSER\AppData\Local\Temp\pip-modern-metadata-4cevnuh2\mypackage.egg-info\requires.txt
  writing top-level names to C:\Users\HIDDENUSER\AppData\Local\Temp\pip-modern-metadata-4cevnuh2\mypackage.egg-info\top_level.txt
  writing manifest file 'C:\Users\HIDDENUSER\AppData\Local\Temp\pip-modern-metadata-4cevnuh2\mypackage.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\HIDDENUSER\AppData\Local\Temp\pip-modern-metadata-4cevnuh2\mypackage.egg-info\SOURCES.txt'
  adding license file 'LICENSE'
  writing manifest file 'C:\Users\HIDDENUSER\AppData\Local\Temp\pip-modern-metadata-4cevnuh2\mypackage.egg-info\SOURCES.txt'
  creating 'C:\Users\HIDDENUSER\AppData\Local\Temp\pip-modern-metadata-4cevnuh2\mypackage-1.0.0.dist-info'
  Running command Building wheel for manim-electronics-test (pyproject.toml)
  C:\Users\HIDDENUSER\AppData\Local\Temp\pip-build-env-ks52g_5g\overlay\Lib\site-packages\setuptools\config\pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
    config = read_configuration(filepath, True, ignore_option_errors, dist)
  running bdist_wheel
  running build
  running build_py
  copying __init__.py -> build\lib
  running egg_info
  writing mypackage.egg-info\PKG-INFO
  writing dependency_links to mypackage.egg-info\dependency_links.txt
  writing entry points to mypackage.egg-info\entry_points.txt
  writing requirements to mypackage.egg-info\requires.txt
  writing top-level names to mypackage.egg-info\top_level.txt
  reading manifest file 'mypackage.egg-info\SOURCES.txt'
  adding license file 'LICENSE'
  writing manifest file 'mypackage.egg-info\SOURCES.txt'
  installing to build\bdist.win-amd64\wheel
  running install
  running install_lib
  creating build\bdist.win-amd64\wheel
  creating build\bdist.win-amd64\wheel\baseclasses
  copying build\lib\baseclasses\constants.py -> build\bdist.win-amd64\wheel\.\baseclasses
  copying build\lib\baseclasses\dot_group.py -> build\bdist.win-amd64\wheel\.\baseclasses
  copying build\lib\baseclasses\element.py -> build\bdist.win-amd64\wheel\.\baseclasses
  copying build\lib\baseclasses\point.py -> build\bdist.win-amd64\wheel\.\baseclasses
  copying build\lib\baseclasses\utils.py -> build\bdist.win-amd64\wheel\.\baseclasses
  copying build\lib\baseclasses\wire.py -> build\bdist.win-amd64\wheel\.\baseclasses
  copying build\lib\baseclasses\_dataclasses.py -> build\bdist.win-amd64\wheel\.\baseclasses
  copying build\lib\baseclasses\__init__.py -> build\bdist.win-amd64\wheel\.\baseclasses
  creating build\bdist.win-amd64\wheel\elements
  copying build\lib\elements\coil.py -> build\bdist.win-amd64\wheel\.\elements
  copying build\lib\elements\diode.py -> build\bdist.win-amd64\wheel\.\elements
  copying build\lib\elements\electronic_scene.py -> build\bdist.win-amd64\wheel\.\elements
  copying build\lib\elements\resistor.py -> build\bdist.win-amd64\wheel\.\elements
  copying build\lib\elements\semicircle.py -> build\bdist.win-amd64\wheel\.\elements
  copying build\lib\elements\__init__.py -> build\bdist.win-amd64\wheel\.\elements
  copying build\lib\__init__.py -> build\bdist.win-amd64\wheel\.
  running install_egg_info
  Copying mypackage.egg-info to build\bdist.win-amd64\wheel\.\mypackage-1.0.0-py3.11.egg-info
  running install_scripts
  creating build\bdist.win-amd64\wheel\mypackage-1.0.0.dist-info\WHEEL
  creating 'C:\Users\HIDDENUSER\AppData\Local\Temp\pip-wheel-5mmk1p1m\.tmp-3xnw6u5b\mypackage-1.0.0-py3-none-any.whl' and adding 'build\bdist.win-amd64\wheel' to it
  adding '__init__.py'
  adding 'baseclasses/__init__.py'
  adding 'baseclasses/_dataclasses.py'
  adding 'baseclasses/constants.py'
  adding 'baseclasses/dot_group.py'
  adding 'baseclasses/element.py'
  adding 'baseclasses/point.py'
  adding 'baseclasses/utils.py'
  adding 'baseclasses/wire.py'
  adding 'elements/__init__.py'
  adding 'elements/coil.py'
  adding 'elements/diode.py'
  adding 'elements/electronic_scene.py'
  adding 'elements/resistor.py'
  adding 'elements/semicircle.py'
  adding 'mypackage-1.0.0.dist-info/LICENSE'
  adding 'mypackage-1.0.0.dist-info/METADATA'
  adding 'mypackage-1.0.0.dist-info/WHEEL'
  adding 'mypackage-1.0.0.dist-info/entry_points.txt'
  adding 'mypackage-1.0.0.dist-info/top_level.txt'
  adding 'mypackage-1.0.0.dist-info/RECORD'
  removing build\bdist.win-amd64\wheel

As you can see, the files are being added somewhere (I suspect to build/lib), but they aren't going to python's site-packages. Any idea how to fix that?

My pyproject.toml:

[project]
name = "manim_electronics_test"  # Required

version = "1.0.0" 

description = "My Custom Package" 
 
readme = "README.md"

requires-python = ">=3.10"

license = {file = "LICENSE"}

keywords = ["manim", "manim community edition", "animation", "extension", "plugin", "electronics"]

authors = [
  {name = "x"},
  {name = "y"}
]

maintainers = [
  {name = "x"},
  {name = "y"}
]

classifiers = [  # Optional

  "Intended Audience :: Developers",

  "License :: MIT License",

  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3 :: Only",
]

dependencies = [ # Optional
  "manim"
]


# The following would provide a command line executable called `mycmd`
# which executes the function `__init__` from this package when invoked.
[project.scripts]
mycmd = "mypackage:__init__"


[tool.setuptools]
packages = ["baseclasses", "elements"]
py-modules = ["__init__"]

[build-system]
requires = ["setuptools>=43.0.0", "wheel"]
build-backend = "setuptools.build_meta"

I have also gone through this answer, but the problem persists (as you can see from the output)

EDIT:

It seems that I can do from elements import * and from baseclasses import *. However, I want it to be from mypackage import * I tried putting all my code in a folder and changing packages to mypackage.baseclasses and stuff, which solved that issue. However, now I can't find any of the folders that pip said it installed...

0 Answers0