Comments (11)
Have you tried:
I had thought that that directory was write protected so that the only way to install a new package would be
pip install --user there
which installs it in the user's home directory. This will survive logouts etc.
I've never investigated but maybe you can set default arguments/options for pip
in its config file? That would let you add --user
as a default argument. Though for teaching purposes I'd spend 2min on explaining that pip install --user
is the way to install something instead of doing "magic".
from hub-ops.
I'd say the answer is "maybe". Any changes made outside of a users home directory are indeed lost across logout/login. However there shouldn't be that many locations the student can write to outside of their home directory.
It would be good to know how they updated earthpy so we can try those commands exactly to reproduce it.
from hub-ops.
Ok. I presume they did a pip install at the terminal and then each time they log back in it rolls back. I was wondering if the docker ok mage takes precedent over any custom envt options?
from hub-ops.
pip install there
(as an example) works and installs the package to /opt/conda/lib/python3.6/site-packages/
. This means it will be lost the next time the container starts/user logs in.
I had thought that that directory was write protected so that the only way to install a new package would be pip install --user there
which installs it in the user's home directory. This will survive logouts etc.
Seems like a bug to me that users can install stuff in a location that is ephemeral. What do you think?
from hub-ops.
never followed up on this but... i agree this is not ideal if users can install things that in turn go away. is there a way for students to install tools so that they remain available to them? honestly i guess do we even want that for a class? perhaps not??
from hub-ops.
Oh!! i haven't tried that @betatim !! i will give it a shot this week however. I see where you are going with that approach. Do you always install using the --user
flag? IE do you think it is more robust??
from hub-ops.
@jlpalomino can you test this out this week please? essentially do this
- login to the hub
- install something -- i guess you could try pip but ideally there is a --user flag for conda forge that we can use! see if that install works - test importing the library.
- then login and quit from the hub.
- then login again -- is that tool still there??
let us know what you discover. if this works we might want to update the docs!!
from hub-ops.
do you think it is more robust?
I don't think it is more robust but it fixes this particular problem I think :)
Do you always install using the
--user
flag
No because normally I am not "imprisoned" in a docker container but on my laptop where you can edit stuff outside your home directory and the changes aren't lost when you logout and back in. The fact that everything outside /home/jovyan
(the user's home directory) is reset to a "pristine state" as define by the docker image each time they login is what is at the root of this problem. I think pip install --user
was invented way-back-when to get around a similar problem: the directories outside your home directory were owned by root
so you couldn't even write to them so the only way to install stuff was to install them i na directory in your home directory.
from hub-ops.
@lwasser I've done some research on install options with conda, and according to various links (stackoverflow, conda github repo), there is not an exact equivalent of pip install --user
.
The closest option appears to be conda create -p /home/user/env-name
followed by conda install -p /user/env-name package-name
, which allows you to create a conda environment in a specific location, such as the user's home directory, and then install the desired package in that conda environment.
For testing in the hub, I started yesterday by installing erddapy using conda install -c conda-forge erddapy
. Then, I logged in and out many times throughout the day, and each time the package was imported successfully. However, today, the package is not found, so the environment resets after a certain amount of time, but not right away after a logout.
Today I ran pip install --user erddapy
(and the import is successful after logging in and out a few times), so I will test tomorrow whether the erddapy package remains in the environment.
from hub-ops.
thank you @jlpalomino for testing this. it's not a huge deal for our classes but will be a potential challenge if anyone wants to use the hub for projects. then again they can always reinstall things if need be!
from hub-ops.
@lwasser Interesting! I can still import erddapy
today after using pip install --user erddapy to install this package yesterday,
from hub-ops.
Related Issues (20)
- git puller quirk / fail HOT 2
- Every commit is taking hours to build HOT 1
- Travis and Hub Deployment - Currently I can't deploy hub updates HOT 5
- Update location of grafana and prometheus charts HOT 5
- Migrate deployment from Travis to Actions HOT 4
- Update docs on how to setup gcloud for cu
- Resource tracking on the hub
- Vector notebooks failing grading on the hub HOT 2
- nbgrader-hub for the spring HOT 1
- revoke user tokens at end of class HOT 5
- migrate new hub to main branch HOT 2
- Move Applications to the Earth lab ORGANIZATION and update docs HOT 3
- PR only build? HOT 7
- remove travis secrets from repo HOT 2
- issues launching the hub HOT 3
- uploading files to the new hub is hanging HOT 1
- hub launch throwing memory errors and is very slow HOT 5
- Remove students from ea-hub
- shut down grading hub for the summer
- issues shutting down the hub HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hub-ops.