Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jupyter import sw error #1320

Closed
patkins opened this issue Jun 16, 2021 · 12 comments
Closed

jupyter import sw error #1320

patkins opened this issue Jun 16, 2021 · 12 comments
Assignees

Comments

@patkins
Copy link

patkins commented Jun 16, 2021

#1273 I am still having issues with the module not found on linux (OpenSUSE15.2) within jupyter only (command line and python seem to be working now). I am also not sure if there is supposed to be a video in the gray box...
image

@cchriste
Copy link
Contributor

cchriste commented Jun 17, 2021

By "command line" do you mean python RunUseCase.py ... or importing from a python session directly executed from the command line?

Example (please try):

  1. start a fresh shell window
  2. conda activate shapeworks
  3. python
  4. import shapeworks

I'll be more baffled if this works but the notebook doesn't.

@cchriste
Copy link
Contributor

I'll be more baffled if this works but the notebook doesn't.

If it does, please also share these two things:
echo $PYTHONPATH
echo $PATH

@cchriste cchriste self-assigned this Jun 17, 2021
@cchriste cchriste added this to the 6.1 Release (June 2021) milestone Jun 17, 2021
@patkins
Copy link
Author

patkins commented Jun 17, 2021

By command line I was referring to shapeworks optimize ..., but python RunUseCase.py ... also works.

wolverine@linux-wa6n:~> conda activate shapeworks
(shapeworks) wolverine@linux-wa6n:~> which shapeworks
/home/programs/ShapeWorks-v6.1.0-rc5-linux/bin/shapeworks
(shapeworks) wolverine@linux-wa6n:~> python
Python 3.7.8 | packaged by conda-forge | (default, Nov 27 2020, 19:24:58)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import shapeworks
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/wolverine/miniconda3/envs/shapeworks/lib/python3.7/site-packages/shapeworks/__init__.py", line 4, in <module>
    from shapeworks_py import *
ModuleNotFoundError: No module named 'shapeworks_py'
>>> quit()
(shapeworks) wolverine@linux-wa6n:~> echo $PATH
/home/wolverine/miniconda3/envs/shapeworks/bin:/usr/local/cuda/bin:/usr/local:/home/wolverine/miniconda3/condabin:/usr/local/cuda/bin:/usr/local:/home/wolverine/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/sbin:/home/programs/ShapeWorks-v6.1.0-rc5-linux/bin/
(shapeworks) wolverine@linux-wa6n:~> echo $PYTHONPATH

@cchriste
Copy link
Contributor

I am also not sure if there is supposed to be a video in the gray box...

@sheryjoe Can you please assign someone to address the missing video issue?

@sheryjoe
Copy link
Contributor

@jadie1 could you check out the video issue?

@iyerkrithika21
Copy link
Contributor

The videos are in place and can be played on other platforms. This issue is related to OpenSUSE and codecs for MP4 videos.
https://www.reddit.com/r/firefox/comments/et4psc/firefox_doesnt_play_mp4_videos_on_opensuse/

@cchriste
Copy link
Contributor

cchriste commented Jun 17, 2021

By command line I was referring to shapeworks optimize ..., but python RunUseCase.py ... also works.

The information you provided is very helpful.

The failure of both the jupyter notebooks and the command line above (running python then directly trying to import shapeworks as you showed) is due to an installation script that was broken until the fix was merged with master this morning.

This new version should work. But before you download and install, I want you to try something directly (deep breath):

  • Edit this file: /home/wolverine/miniconda3/envs/shapeworks/lib/python3.7/site-packages/shapeworks/setup_path.py
  • Change the empty string on the third line ("") to look like this: "/home/programs/ShapeWorks-v6.1.0-rc5-linux/bin/"

Then like before simply run python from the command line and import shapeworks.

@patkins
Copy link
Author

patkins commented Jun 17, 2021

For clarification, I can run use cases via the command python RunUseCase.py --use_case usecasename.

@patkins
Copy link
Author

patkins commented Jun 17, 2021

@cchriste Your suggested edit to setup_path.py also worked, so within python, I can import shapeworks.

@cchriste
Copy link
Contributor

@cchriste Your suggested edit to setup_path.py also worked, so within python, I can import shapeworks.

Great! Our latest installable versions will correctly configure this.

It will also work from your jupyter notebooks (please verify for us) no matter what directory you start the server from, and RunUseCase.py will work similarly from anywhere you call it.

@cchriste cchriste added the QA label Jun 17, 2021
@cchriste
Copy link
Contributor

I just verified Windows install works (simultaneously, Alan had a conda issue similar to the one described above; I added conda env remove -n shapeworks in #1330, which might help and won't hurt). Closing this issue.

@jadie1
Copy link
Contributor

jadie1 commented Jun 17, 2021

The videos are in place and can be played on other platforms. This issue is related to OpenSUSE and codecs for MP4 videos.
https://www.reddit.com/r/firefox/comments/et4psc/firefox_doesnt_play_mp4_videos_on_opensuse/

@patkins I open the notebooks on Chrome with OpenSUSE and they display correctly. Not sure what we can do about the OpenSUSE/firefox issue.

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

No branches or pull requests

5 participants