Skip to content

Fix local installation#59

Open
dm-ackerman wants to merge 1 commit intoFarama-Foundation:mainfrom
dm-ackerman:main
Open

Fix local installation#59
dm-ackerman wants to merge 1 commit intoFarama-Foundation:mainfrom
dm-ackerman:main

Conversation

@dm-ackerman
Copy link
Copy Markdown

pip install -e . was failing.
The previous setup was creating a libmagent.so file, but the build script was looking for a cpython specific library file. This failed because it didn't exist, breaking the build. It then tried to load the libmagent.so file which wasn't correct because it was supposed to use the cpython specific file.

Fixing both of these issues, it now installs with pip install -e .
This works on linux, probably works on mac. I have no idea on windows

I do not know if this will package correctly for pip install with pypi

`pip install -e .` was failing.
The previous setup was creating a libmagent.so file, but the build
script was looking for a cpython specific library file. This failed
because it didn't exist, breaking the build. It then tried to load
the libmagent.so file which wasn't correct because it was supposed
to use the cpython specific file.

Fixing both of these issues, it now installs with pip install -e .
This works on linux, probably works on mac. I have no idea on windows

I do not know if this will package correctly for pip install with pypi
@lgolstongov
Copy link
Copy Markdown

I tested on Windows today and found that:

  1. To get pip install . working in general I first had to unpin numpy from 1.x in pyproject.toml and remove "--target", "ALL_BUILD" from setup.py
  2. pip install -e . then failed for the reasons described above by @dm-ackerman, which the PR fixed, except for one change: lib_ext = ".dll" created a double period so had to modify to lib_ext = "dll"

@atstarke
Copy link
Copy Markdown
Collaborator

atstarke commented Aug 4, 2025

Hello!

Sorry for the delay!

Let me first say thank you for taking the time to contribute and I apologize for how long it has taken me to respond.

I am unable to test Linux or Mac as all I have is a Windows machine. When I tried installing this branch on Windows I ran into a build error:

error: Expected CMake build output ...\magent..dll not found.

It looks like the build script is looking for a DLL with an unexpected name, and the .dll is not being produced as expected for Windows. Do you have any insight in what may be the issue?

Thanks again!

hxypqr added a commit to hxypqr/MAgent2 that referenced this pull request Feb 24, 2026
- Fix c_lib.py: replace hardcoded venv path with automatic library discovery
- Fix CMakeLists.txt: separate MSVC/GCC flags, use CMAKE_CXX_STANDARD
- Fix setup.py: remove deprecated self.debug, unify cross-platform cmake build
- Fix Range.h: sizeof(bool) -> sizeof(int) in copy constructor (data corruption bug)
- Fix C++ headers: tgmath.h -> cmath, stdlib.h -> cstdlib, assert.h -> cassert
- Fix magent_env.py: update deprecated seeding.np_random() API
- Update pyproject.toml: Python >=3.10, remove numpy <2.0 upper bound
- Update CI: Python 3.10-3.12 matrix, upgrade actions to v4/v5
- Update pre-commit: pyupgrade --py310-plus
- Update README and docs with modern usage examples
- Add battle_demo.py and battle_video.py examples
- Bump version to 0.4.0

Tested with Python 3.11, numpy 2.3, gymnasium 1.2.3, pettingzoo 1.25, pygame 2.6.1

Fixes Farama-Foundation#63, Farama-Foundation#59, Farama-Foundation#57, Farama-Foundation#54, Farama-Foundation#53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants