I made private clones of two repos on Github to test new functionality that I’m exploring on Google Colab. In the first cell of my Google Colab notebooks, I have the following code which clones my personal clones on Github down to my Google Colab terminal and then installs the packages from the created directories:
## install elegantrl library
!git clone https://*private token*digofr/ElegantRL.git
!pip install ./ElegantRL/
## install finrl library
!git clone https://*private token*digofr/FinRL.git
!pip install ./FinRL/
Once the directories content/ElegantRL/ and content/FinRL/ are created after the clone command, I can find in them my new files and changes to both repos (confirming that Google Colab cloned my repos and not the original ones). However, for the ElegantRL package, I have to manually copy the new modules I wrote for it to the ./usr/local/lib/python3.10/dist-packages/elegantRL directory after I issue the command “pip install ./ElegantRL/” (and I also need to overwrite some of the modules that appear there in their original version with my updated versions). I have to do this every time I initiate a new runtime on Google Colab, otherwise I can’t use my new functions because python doesn’t find them. Fortunately, I don’t need to do this for the FinRL package as well; it installs as expected.
I didn’t change the setup.py modules in either of the original repos. For ElegantRL reads:
from setuptools import setup, find_packages
setup(
name=”ElegantRL”,
version=”0.3.7”,
author=”AI4Finance Foundation”,
author_email=”[email protected]”,
url=”https://github.com/AI4Finance-Foundation/ElegantRL”,
license=”Apache 2.0”,
packages=find_packages(),
install_requires=[
“torch”,
“numpy”,
“matplotlib”,
“gym”,
“gym[Box2D]",
],
description=”Lightweight, Efficient and Stable DRL Implementation Using PyTorch”,
classifiers=[
# Trove classifiers
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
keywords="Deep Reinforcement Learning",
python_requires=">=3.6”,
)
One thing that I also noticed is that I do get an installation error every time I install the ElegantRL package (but not with FinRL). I don’t know if it is related to this problem, but at least it doesn’t seem to cause any further issues. The error log reads:
Building wheels for collected packages: ElegantRL, box2d-py
Building wheel for ElegantRL (setup.py) … done
Created wheel for ElegantRL: filename=ElegantRL-0.3.7-py3-none-any.whl size=198800 sha256=9f2562bed77a0361e700ed3b1966fb8975cbe39c5daba21b7dafec1e2edc6ca3
Stored in directory: /tmp/pip-ephem-wheel-cache-6bryulqo/wheels/89/2f/3d/d0aaf7020f4fb8e091b240743b79d45a69b2d5531003f2f007
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Building wheel for box2d-py (setup.py) … error
ERROR: Failed building wheel for box2d-py
Running setup.py clean for box2d-py
Successfully built ElegantRL
Failed to build box2d-py
ERROR: Could not build wheels for box2d-py, which is required to install pyproject.toml-based projects
I’d like not to need to copy manually my new modules to the /dist-packages/ directory every time I install my version of the ElegantRL repo on a new terminal.
Rodrigo Ferreira da Rosa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.