You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
README.md needs instructions for how to manually update the lib for developers #287
Seriously, either keep it simple or tell people how to do it. I've tried:
# on the ev3
mkdir ev3dev
# on development laptop:
<make changes>
scp ev3dev/*.py robot@ev3dev.local:ev3dev/
# on ev3
sudo mv *.py /usr/lib/python3/dist-packages/ev3dev/
but after that I only get python errors (e.g. instantiating motors fails).
changed the title [-]README.mc needs instructions for how to manually update the lib for developers[/-][+]README.md needs instructions for how to manually update the lib for developers[/+]on Jan 29, 2017
Well, the installed stuff is installed with apt-get, so I guess the only correct way to test things would be to uninstall the system package first, then run ./setup.py install from the cloned repo.
It sounds like you're looking for the equivalent of npm link from the JavaScript world... I can't seem to find anything similar in Python package managers though.
@dwalton76 if I follow your instructions, it will be installed to /usr/local/lib/python3.4/dist-packages/ where as the debian package is in /usr/lib/python3/dist-packages/. That usually is a recipe for disaster (especially so since setup.py cannot easily uninstall stuff). But it seems to be only one single file:
/usr/local/lib/python3.4/dist-packages/python_ev3dev-0.8.0.post32-py3.4.egg
Besides the concern of having multiple versions installed, python seems to pickup the /usr/local/ one. Verified by looking for the new Sound.get_volume() api.
Right you do end up with two copies which is not ideal but I've never run into issues with it since the copy in /usr/local/lib/python3.4/dist-packages/ is found first via your PYTHON_PATH. I just rm -rf the /usr/local/lib/python3.4/dist-packages/ copy if I want to go back to using the version installed via the deb. Most of the time I just end up using the copy installed via setup.py though as I'm continuing to do dev on it.
You could always uninstall the copy from the debian package to avoid having two copies.
Activity
[-]README.mc needs instructions for how to manually update the lib for developers[/-][+]README.md needs instructions for how to manually update the lib for developers[/+]ddemidov commentedon Jan 29, 2017
What I do in order to test things out, is
Now, you can do your changes to the local copy. When you do
while in the
ev3dev-lang-pythonfolder, it should import from local folder instead of from system-installed one.ensonic commentedon Jan 29, 2017
Unfortunately this won't work for installed stuff. The openrobertalab is a package with a service run by systemd.
ddemidov commentedon Jan 29, 2017
Well, the installed stuff is installed with apt-get, so I guess the only correct way to test things would be to uninstall the system package first, then run
./setup.py installfrom the cloned repo.ensonic commentedon Jan 29, 2017
Nah, just need to get the right files to the right locations. I'll check the layout of the src tree and the installed files.
WasabiFan commentedon Jan 29, 2017
It sounds like you're looking for the equivalent of
npm linkfrom the JavaScript world... I can't seem to find anything similar in Python package managers though.dwalton76 commentedon Jan 30, 2017
You can do
Then whenever you make changes run the "sudo python3 setup.py install" again
dwalton76 commentedon Jan 30, 2017
@ensonic can you confirm that does the trick for openrobertalab
ensonic commentedon Feb 2, 2017
@dwalton76 if I follow your instructions, it will be installed to /usr/local/lib/python3.4/dist-packages/ where as the debian package is in /usr/lib/python3/dist-packages/. That usually is a recipe for disaster (especially so since setup.py cannot easily uninstall stuff). But it seems to be only one single file:
/usr/local/lib/python3.4/dist-packages/python_ev3dev-0.8.0.post32-py3.4.egg
Besides the concern of having multiple versions installed, python seems to pickup the /usr/local/ one. Verified by looking for the new Sound.get_volume() api.
dwalton76 commentedon Feb 2, 2017
Right you do end up with two copies which is not ideal but I've never run into issues with it since the copy in /usr/local/lib/python3.4/dist-packages/ is found first via your PYTHON_PATH. I just rm -rf the /usr/local/lib/python3.4/dist-packages/ copy if I want to go back to using the version installed via the deb. Most of the time I just end up using the copy installed via setup.py though as I'm continuing to do dev on it.
You could always uninstall the copy from the debian package to avoid having two copies.
ensonic commentedon Feb 2, 2017
I can't uninstall the python library, since that will install packages depending on it. I'll send a PR for the docs with the gist of this thread.
WasabiFan commentedon Sep 19, 2017
I believe this is the currently recommented list of options:
PYTHONPATHFeel free to update this with more. I'm not going to close this immediately as it would be nice to add complete instructions to the README.
dlech commentedon Sep 19, 2017
no underscore in
PYTHONPATHenvironment variable name.WasabiFan commentedon Sep 19, 2017
Updated. I could've sworn there was one 🤔
WasabiFan commentedon Dec 19, 2018
It looks like this was mostly resolved so I'm going to close the issue. Please reopen or submit a PR if there is a change that's still needed.