Closed moorepants closed 2 years ago
I tried to install sympy 1.9 using vocpipinstall3.6 sympy==1.9
but if failed to install. Also it seemed to be upgrading a sympy 1.3 install which is not the same one the students have access to in the jupyter notebook. If you type !pip freeze
in the notebook instead of !{sys.executable} -m pip freeze
while in a Vocareum notebook then you get two different sets of packages. The vocpipinstall3.6
command seems to install things in the latter, which is not what students have access to in the notebook.
BTW, this is the instructions Vocareum provides: https://help.vocareum.com/en/articles/3658985-installing-python-packages
Create a new assignment
Create a new part
Configure workspace
Launch jupyter server
Create a new Python 3.8 notebook
sys.executable
in the notebook gives `'/usr/local/bin/python3.8'
sympy.__file__
gives `'/usr/local/lib/python3.8/site-packages/sympy/init.py'
sympy.__version__
gives 1.7.1
Click view standard
Now in the workspace terminal
which python
-> /usr/local/bin/python
which python3.8
-> /usr/local/bin/python3.8
Now try to pip upgrade the packages with the Python 3.8 interpreter, which gave:
ddd_v1_t_olvC_735068@runweb47395:~$ python3.8 -m pip install -U sympy numpy scipy matplotlib
Defaulting to user installation because normal site-packages is not writeable
Collecting sympy
Downloading sympy-1.9-py3-none-any.whl (6.2 MB)
|████████████████████████████████| 6.2 MB 7.2 MB/s
Collecting numpy
Downloading numpy-1.22.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB)
|████████████████████████████████| 16.8 MB 104.2 MB/s
Collecting scipy
Downloading scipy-1.7.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (39.3 MB)
|████████████████████████████████| 39.3 MB 101.3 MB/s
Collecting matplotlib
Downloading matplotlib-3.5.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.3 MB)
|█████████████████████ | 7.4 MB 106.9 MB/s eta 0:00:01Warning - the output rate '97134.2268842269 bytes/s' has exceeded the allowed value
'6000 bytes/s'; attempting to kill the process. Please use Ctrl-C to return to the prompt.
So it timed out or something on matplotlib.
Try upgrading each package separately, which worked:
ddd_v1_t_olvC_735068@runweb47395:~$ python3.8 -m pip install -U scipy
Defaulting to user installation because normal site-packages is not writeable
Collecting scipy
Using cached scipy-1.7.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (39.3 MB)
Requirement already satisfied, skipping upgrade: numpy<1.23.0,>=1.16.5 in ./.local/lib/python3.8/site-packages (from scipy) (1.22.1)
Installing collected packages: scipy
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves depen
dency conflicts.
We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.
pyscf 1.7.5.1 requires scipy<1.5, but you'll have scipy 1.7.3 which is incompatible.
pandapower 2.7.0 requires scipy<=1.6.0, but you'll have scipy 1.7.3 which is incompatible.
Successfully installed scipy-1.7.3
WARNING: You are using pip version 20.2.3; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python3.8 -m pip install --upgrade pip' command.
ddd_v1_t_olvC_735068@runweb47395:~$ python3.8 -m pip install -U matplotlib
Defaulting to user installation because normal site-packages is not writeable
Collecting matplotlib
Downloading matplotlib-3.5.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.3 MB)
|████████████████████████████████| 11.3 MB 6.1 MB/s
Requirement already satisfied, skipping upgrade: pyparsing>=2.2.1 in /usr/local/lib/python3.8/site-packages (from matplotlib) (2.4.7)
Collecting fonttools>=4.22.0
Downloading fonttools-4.29.0-py3-none-any.whl (895 kB)
|████████████████████████████████| 895 kB 71.1 MB/s
Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in /usr/local/lib/python3.8/site-packages (from matplotlib) (1.3.1)
Requirement already satisfied, skipping upgrade: numpy>=1.17 in ./.local/lib/python3.8/site-packages (from matplotlib) (1.22.1)
Requirement already satisfied, skipping upgrade: packaging>=20.0 in /usr/local/lib/python3.8/site-packages (from matplotlib) (20.8)
Requirement already satisfied, skipping upgrade: pillow>=6.2.0 in /usr/local/lib/python3.8/site-packages (from matplotlib) (7.2.0)
Requirement already satisfied, skipping upgrade: cycler>=0.10 in /usr/local/lib/python3.8/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.7 in /usr/local/lib/python3.8/site-packages (from matplotlib) (2.8.1)
Requirement already satisfied, skipping upgrade: six in /usr/local/lib/python3.8/site-packages (from cycler>=0.10->matplotlib) (1.15.0)
Installing collected packages: fonttools, matplotlib
Successfully installed fonttools-4.29.0 matplotlib-3.5.1
WARNING: You are using pip version 20.2.3; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python3.8 -m pip install --upgrade pip' command.
sympy.__file__
now gives: `'/mnt/voccontent/teacherlib/ddd_v1_t_olvC_735068/work/asn719011_4/asn719012_1/work/.local/lib/python3.8/site-packages/sympy/init.py'sympy.__version__
now gives: '1.9'
python3.8 -m pip install pythreejs
ddd_v1_t_olvC_735068@runweb47429:~$ python3.8 -m jupyter nbextension install --p
Exception while loading config file /etc/jupyter/jupyter_notebook_config.py
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/traitlets/config/application.
config = loader.load_config()
File "/usr/local/lib/python3.5/dist-packages/traitlets/config/loader.py",
self._read_file_as_dict()
File "/usr/local/lib/python3.5/dist-packages/traitlets/config/loader.py",
py3compat.execfile(conf_filename, namespace)
File "/usr/local/lib/python3.5/dist-packages/ipython_genutils/py3compat.py
exec(compiler(f.read(), fname, 'exec'), glob, loc)
File "/etc/jupyter/jupyter_notebook_config.py", line 2, in <module>
from voc_origin_config import VocOrigin
ImportError: No module named 'voc_origin_config'
Traceback (most recent call last):
File "/usr/local/bin/jupyter-nbextension", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.5/dist-packages/jupyter_core/application.py", lin
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/traitlets/config/application.py",
app.start()
File "/usr/local/lib/python3.5/dist-packages/notebook/nbextensions.py", line 9
super(NBExtensionApp, self).start()
Release notebooks, update, go to student view and it seems that the packages are also up-to-date for the students:
One more thing to check here is whether these updated packages will be used when vocareum runs nbgrader to grade the assignments. I read in the vocareum website that this may not be the case. :(
Bad news. Even though I've installed the packages for the teacher and the student (which seems to work), the grading environment does not have the up-to-date packages. In the sandbox I have an assignment and notebook that tests the cse=True
option in lambdify()
and it fails after pressing submit:
I now tried vocpipinstall3.8 -U sympy numpy scipy matplotlib
which is supposed to do a "global" install, but it says everything is satisfied and doesn't upgrade. I'm guessing that means that the grading environment doesn't get upgraded if that is the command that is supposed to do it.
This prints the sympy version just before submission: It's now at sympy 1.7.1.
Going back to teacher view and running the notebook shows sympy 1.9.
I chatted with Vocaerum support. Seems like there is no way for me to get consistent packages installed across teacher, student, grading environments on my own. Apparently, the standard procedure is to write to them with a request for a custom package setup. Here is my chat:
V> Hi 😀 Have a look around! Let us know if you have any questions. J> I can't figure out how to provide updated Python packages that are available in the teacher, student, and grading environments. vocpipinstall3.8 says that my package is at the correct version but the grading fails because it the envrinoment used for grading still has old packages. V> Give the team a way to reach you: V> Operator profile V> You'll be notified here and by email J> j.k.moore@tudelft.nl K> Hi, Which course or assignment is this for? We will take a closer look at the issue. Thanks, Kevin J> I have a sandbox in brightspace. I want to use the latest versions of sympy, numpy, scipy, and matplotlib. K> Ok taking a look now J> test_autograder_with_sympy_1point9 is the notebook J> the sm.lambdify(..., cse=True) is failing J> cse=True is an option available in sympy 1.9 only J> assignment name " Trying custom package installa..." J> I've also been struggling to install jupyter notebook extensions so they are available in all environments for the right python version. Seems jupyter is running on pthon 3.5 (which is no longer supported btw) but the kernels are newer, so you have to install old versions of extensions to get things to possibly work. J> but that's issue #2 J> For issue #1, I want to update python packages to the latest versions for student, teacher, and grading environments for the python3.8 kernel. J> Trying to figure out that procedure. This article https://intercom.help/vocareum/en/articles/3658985-installing-python-packages hasn't gotten me where I need to be. J> And be able to do that for all my assignments, reproducibly. J> More info on my trials, if relevant: https://github.com/moorepants/me41055/issues/9 J> Hi, it's been 17 minutes. Are you still checking? Any updates? K> Hi, Yes. We will have to pass this on to our installation team once we finish checking all the packages. Kevin J> ok, should I wait here or for an email? J> The basic question is how to updgrade packages to the same versions across student, teacher, grading. J> I can't figure it out from your documentation. K> Wait for an email as it can take a day for the installation team to properly update and test across the whole environment to make sure the packages are all the same J> Ok, so if I want this ready for my class next, week, it sounds like I have to rely on you all. J> Should I send an email with all the packages I need installed across the evenironments? J> What's the basic procedure for this? J> Most of the default packages you all have are quite old. J> Including some python versions. J> Is there a standard procedure for getting things upgraded and setup? K> The standard procedure is to let us know and we will have our team install the proper packages. You said in a previous message you wanted the latest versions of sympy, numpy, scipy, and matplotlib. All for 3.8 correct? J> Ok, good to know that's the procedure. J> Can I send an email with my requests? J> What email address? K> Yes, please send it to kevin@vocareum.com and I will pass it along. J> great, thanks J> I'll send it in a few minutes J> Thanks for the help. K> You're very welcome. I will keep you updated and let you know when the new packages are ready
I've emailed support with this request:
Hi Kevin,
I am at TU Delft. I have two courses in Brightspace that I'd like updated:
We are testing things in the sandbox and then going to make the actual assignments in the Multibody B course.
I will use the Python 3.8 kernel in the Jupyter notebook and make use of nbgrader autograder cells and want the same packages set up consistently across those three environments.
I'd like these packages at their latest versions for Python 3.8 across teacher, student, and grading environment:
I'm trying to get my first homework posted and shared by Friday here. If it is possible to have these working asap, that would be helpful. But I can avoid new features in the packages for the first homework if more time is needed.
I will also have some more packages that need installation for later in the course. Some of them are non-trivial to install with pip due to C extension compilation. Will you all also manage these installations with a future request?
Jason
Just got an update from Kevin: "As of right now they are still being worked on, so at this time I do not believe they will be ready by this Friday. I will let you know as soon as they have been tested and are ready to go. I cannot give an ETA right now, but I will try to get it done as soon as possible if not by this weekend."
I tried adding import sys;!{sys.executable} -m pip install -U sympy
at the top of the notebook and then submitting for the grade checker. But this didn't even work. I don't understand why that wouldn't work.
I just tried this experiment again with a new notebook and it now seemed to work:
Running sympy and numpy updates in the student view has some interesting conflict messages:
Vocareum has updated the packages for the Jupyter 3.8 kernel for numpy, sympy, matplotlib, and scipy. Here is the message from Sarah:
Good morning Jason,
I have a message from Vocareum for late last night our time:
sympy 1.9, numpy 1.22.1, scipy 1.7.3 and matplotlib 3.5.1 have all been installed for Python 3.8. We have sent a priority request to our installation team to install pandas 1.4.0 for Python 3.8. As well as ipympl and ipywidgets for Python 3.5. We will update you as soon as they are ready to use.
As soon as I have confirmation that they're ready to use, I'll let you know.
Take care, Sarah
I just checked it in the "Jason's test (ignore)" assignment with grading and it all works. The new sympy methods are available. So we will not need the hack to get things installed there.
I will work with them to get the other packages updated and installed for Q4. So closing this issue now.
Just for later reference: I had a phone call with Sarah (TUD) and Sanjay (Vocareum) and we can send them requests to install packages for us. He said they can typically do it in 48 hours. So that should be the standard approach.
When in a Jupyter notebook on Vocareum you can type:
to see all of the packages available for the notebook environment. This is the list on 2022-01-19:
THe most recent versions of the primary packages are:
Other packages we may need:
Note that conda does not seem to be used or be available in Vocareum.