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
Need a sw startup script and check/error messages when user forgets to run it (e.g., when they try to use RunPython.py) #478
Comments
More generally, because there is more than just
This For Studio I don’t know, but the creation of an API will be important for any future remote GUIs. The framework API will serve as a very solid foundation for current users and for future API exposures such as MATLAB and Java (our users have expressed immediate interest in both Python and MATLAB), so we should ensure it’s accessible by providing a simple startup script. |
The original part of this issue was addressed in PR #491. When the python tests run, they will give a more informative error message when conda isn't activated. |
We need a
As of today on OSX in executable branch, no LD_LIBRARY_PATH is needed for any standalone executable or Studio, so we can (with gratitude on a number of levels) avoid setting LD_LIBRARY_PATH. Starting a potential Jupyter server and/or setting PYTHONPATH can be part of pybind work, so the script described above will be sufficient to resolve this issue. |
I committed a |
The |
The challenge mentioned in the version of the |
How about those (us) building from source? aren't those paths already known when we build? |
Sorry, I think this issue was discussed elsewhere. We can probably create the setupenv script (and .bat) using CMake in the same way we create the TestConfiguration.h starting with TestConfiguration.h.in. Cmake fills in these macros because it knows the path to the dependencies' install and ShapeWorks build and install directories. A downloadable user deployment is actually more difficult than a developer build because the path to their installation is less known. On OSX it will most likely be /Application/ShapeWorks/<paths to bin and studio/macos/bin>; on Windows I'm not sure; and on Linux it could be virtually anywhere. Maybe we need to provide an installer and/or setup script for users to enter these directories and create the setupenv script (we could call it startsw or something different, short and sweet and clear to the user). |
For Windows, a Start Menu item can be added to setup the SW environment and open a prompt. |
Another option: for releases, |
Similar to Karthik's suggestion, a ShapeWorks conda package will do just that. #865 |
@cchriste @akenmorris is this still an issue? |
Yes. I suggest we use Karthik's proposal. |
Good idea from Alan: add a shortcut to open Anaconda Prompt with location of shapeworks and ShapeWorksStudio added to the PATH, and PYTHONPATH updated to find the shapeworks library. We could also add a shortcut to just start jupyter-notebook with all these things setup. For osx and linux, the startup script will activate conda, add necessary stuff to all the paths, and be good. No more need to have customized notebooks and use case scripts that work so hard to add things to paths. Putting things in CONDA_ENV/bin would be nice, but with potentially unknown consequences, and it wouldn't take care of everything such as ld_library_path on linux and maybe pythonpath. |
scripts to start notebook and start shell with conda activated and paths added @cchriste --- could be needed for the workshop users |
In summary... a handy osx/linux:
windows:
|
We're working towards having no need for startup scripts, but we currently don't handle non-standard installation paths (#1328), and it would still be worthwhile to provide Windows shortcuts in the ShapeWorks menu that start Jupyter notebooks and shapeworks-activated Anaconda shells. |
For Windows, this seems like an excellent option for installation: https://github.com/faph/NSIS-Conda-Macros For all platforms a conda package would be very worthwhile, including path safety, the ability to have multiple installs simultaneously (in different conda environments), and simplicity of user vs developer installation of dependencies. (we discussed this previously in other issues such as #865). We may want to divide this into two issues: Windows installer and ShapeWorks conda package. |
Exactly. |
As of pr #1338 RunUseCase now try/excepts to ensure that both the shapeworks executable and python module are successfully found/imported, reminding the user to conda activate and directing them to the appropriate link in the documentation for installation. No other path arguments are any longer necessary for this script or any other python import or executable access. |
Our users typically get something like this when they forget the "conda activate shapeworks" step:
ImportError: No module named termcolor
Can we add a check to our python scripts that can instead print an error message saying "please run 'conda activate shapeworks'"?
It may also be needed for running Studio.
The text was updated successfully, but these errors were encountered: