0

I want to write a python script that automatically compiles my python package using the command: python setup.py sdist bdist_wheel
My setup.py is the following:

from setuptools import setup, find_packages

with open("README.md", "r") as f:
    description = f.read()

with open("VERSION", "r") as f:
    version = f.read()


setup(
    name="PygameBasis",
    version=version,
    packages=find_packages(),
    install_requires=['pygame-ce'],
    python_requires=">3.12",
    long_description=description,
    long_description_content_type="text/markdown",
)

When I try running the command using the subprocess package with subprocess.run(["python", "setup.py", "sdist", "bdist_wheel"]), I get the following error:

Traceback (most recent call last):
  File "PATH\PygameBasis\setup.py", line 1, in <module>
    from setuptools import setup, find_packages
ModuleNotFoundError: No module named 'setuptools'

I tried running subprocess.run(["pip", "install", "setuptools"]) before the command and that gave me:

Requirement already satisfied: setuptools in PATH\pygamebasis\venv\lib\site-packages (75.1.0)
Traceback (most recent call last):
  File "PATH\PygameBasis\setup.py", line 1, in <module>
    from setuptools import setup, find_packages
ModuleNotFoundError: No module named 'setuptools'

I am on Windows 11 with python 3.12 if that's of importance.

6
  • Is setuptools in your requirements.txt file? I'd assume that's the issue. Commented Oct 8, 2024 at 19:09
  • I added it, but it doesnt change the error message. Commented Oct 9, 2024 at 8:38
  • Hey, are you running this in the venv? Have you activated it? Commented Oct 16, 2024 at 17:22
  • Well the project is set up with a venv, altho I dont know if subprocess is using it. Commented Oct 23, 2024 at 4:23
  • Did you fix this? My only other idea was to check whether you're running it inside the venv, and whether you've ran source ./bin/activate Commented Nov 26, 2024 at 19:15

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.