← All tasks
pythonBarnard-PL-Labs/MaxPyLang #4Reported task

Installation fixes

envgap__Barnard-PL-Labs__MaxPyLang-4

01 / FAILURE SIGNATURE

Captured in a clean container

ModuleNotFoundError: No module named 'maxpy.tools'

02 / ENVIRONMENT RECIPE

Base commit
eeabe7618bd755f163c79eb97411286609fc5e17
Manifest
setup.py
Reproduce
cd /tmp && python3 -c 'import json,maxpy; patch=maxpy.MaxPatch(); osc=patch.place('"'"'cycle~ 440'"'"'); dac=patch.place('"'"'ezdac~'"'"'); patch.connect((osc[0].outs[0],dac[0].ins[0])); patch.save('"'"'/tmp/envgap.maxpat'"'"'); data=json.load(open('"'"'/tmp/envgap.maxpat'"'"')); assert len(data['"'"'patcher'"'"']['"'"'boxes'"'"'])==2; assert len(data['"'"'patcher'"'"']['"'"'lines'"'"'])>=1; print('"'"'generated MaxMSP patch:'"'"',len(data['"'"'patcher'"'"']['"'"'boxes'"'"']),'"'"'objects'"'"')'
Run under trace
cd /tmp && python3 -c 'import json,maxpy; patch=maxpy.MaxPatch(); osc=patch.place('"'"'cycle~ 440'"'"'); dac=patch.place('"'"'ezdac~'"'"'); patch.connect((osc[0].outs[0],dac[0].ins[0])); patch.save('"'"'/tmp/envgap.maxpat'"'"'); data=json.load(open('"'"'/tmp/envgap.maxpat'"'"')); assert len(data['"'"'patcher'"'"']['"'"'boxes'"'"'])==2; assert len(data['"'"'patcher'"'"']['"'"'lines'"'"'])>=1; print('"'"'generated MaxMSP patch:'"'"',len(data['"'"'patcher'"'"']['"'"'boxes'"'"']),'"'"'objects'"'"')'
Reference environment fix used for admission
diff --git a/setup.py b/setup.py
index 0ac2364..20d8213 100644
--- a/setup.py
+++ b/setup.py
@@ -1,11 +1,12 @@
-from distutils.core import setup
+from setuptools import setup, find_packages
 
 setup(
     name='MaxPy',
     version='0.1.0',
     author='Ranger Liu',
     author_email='ranger.liu@columbia.edu',
-    packages=['maxpy', 'maxpy.test'],
+    packages=find_packages(),
+    package_data={'maxpy': ['data/*.json', 'data/*/*.json', 'data/*/*/*.json']},
     scripts=[],
     url='http://pypi.python.org/pypi/MaxPy/',
     license='LICENSE.txt',
@@ -14,5 +15,6 @@ setup(
     install_requires=[
         "numpy == 1.22.3",
         "sphinx_rtd_theme",
+        "tabulate==0.9.0",
     ],
 )

03 / ORIGINAL ISSUE TEXT

Barnard-PL-Labs/MaxPyLang #4 · read the original issue
## Installation Issues and Workarounds

**DO NOT use `pip install maxpy`** - MaxPy is not properly published on PyPI, and there's a naming conflict with "MAxPy" (a different project).

### Manual Installation from GitHub

The MaxPy package has several issues preventing standard installation:

1. **Python 3.12 incompatibility**: The package specifies `numpy==1.22.3`, which requires Python's deprecated `distutils` module
2. **Missing subpackages**: The `setup.py` doesn't include `maxpy.tools` and `maxpy.data` directories
3. **Undeclared dependencies**: `tabulate` is required but not in `install_requires`

**Working installation procedure**:

```bash
# 1. Clone the repository
git clone https://github.com/Barnard-PL-Labs/MaxPy.git /tmp/MaxPy-temp

# 2. Install without dependencies (to avoid numpy version conflict)
pip install --no-deps /tmp/MaxPy-temp/

# 3. Manually copy missing package directories
cp -r /tmp/MaxPy-temp/maxpy/tools ./maxpy/lib/python3.12/site-packages/maxpy/
cp -r /tmp/MaxPy-temp/maxpy/data ./maxpy/lib/python3.12/site-packages/maxpy/

# 4. Install required dependencies (modern versions)
pip install numpy tabulate
```

### Package Naming Conflict

There is a namespace conflict between two different packages:
1. **MaxPy** (Barnard-PL-Labs) - MaxMSP metaprogramming tool (this project)
2. **MAxPy** (MAxPy-Project) - Multi-layer Approximate Computing framework

MAxPy contains a submodule `maxpy.py`, creating a namespace collision. If MAxPy is installed, `import maxpy` may incorrectly resolve to `MAxPy.maxpy`.
Continue on GitHub ↗

04 / LABELS

Labels checked by running the task · assistant reviewed

misspecificationunderspecification
Label rules and the text that matched
[
  {
    "category": "misspecification",
    "rule": "diff.changes_existing_manifest_line",
    "source": "manifest_diff:setup.py",
    "excerpt": "-from distutils.core import setup\n-    packages=['maxpy', 'maxpy.test'],\n+from setuptools import setup, find_packages\n+    packages=find_packages(),\n+    package_data={'maxpy': ['data/*.json', 'data/*/*.json', 'data/*/*/*.json']},\n+        \"tabulate==0.9.0\","
  },
  {
    "category": "underspecification",
    "rule": "diff.adds_omitted_runtime_requirement",
    "source": "manifest_diff:setup.py",
    "excerpt": "tabulate"
  }
]

Historical install-only results are not EnvGap validation.

Official Python image is Python3.10, so this task tests the issue's missing installed subpackages/resources and undeclared tabulate, not its separate Python3.12/numpy incompatibility.

The pinned numpy1.22.3 is retained; the gold adds packaging discovery/data and tabulate only. MaxMSP is not launched; its generated patch JSON is checked.

The README connect([objects]) shorthand is stale at this commit; the workload follows the dated connect() docstring requiring an Outlet/Inlet tuple and place() returning lists. The same corrected API workload is used for original and gold.

Preparation uses current registries. Historical package availability is not enforced here; execution metadata records this limitation separately from the oracle's date-bounding policy.