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

Ryven | Load Example | demo_example.json can't find PythonOCC #11

Open
WillAdams opened this issue Jan 17, 2022 · 15 comments
Open

Ryven | Load Example | demo_example.json can't find PythonOCC #11

WillAdams opened this issue Jan 17, 2022 · 15 comments

Comments

@WillAdams
Copy link

Click on "AUTO IMPORT" and it finds std but can't find PythonOCC

@leon-thomm
Copy link
Contributor

yes, it doesn't know where the nodes package is, because when the creator of the project used it on his machine, it was under a different path. you need to locate it manually: click on ADD, navigate to your clone of this repo and select Pythonocc-nodes-for-Ryven/PythonOCC/nodes.py. If you then save the project on your machine it will update the paths in the project file and you don't have to locate it again next time

@WillAdams
Copy link
Author

I don't understand "clone of this repo"?

Wasn't it installed by the command "conda install -c conda-forge pythonocc-core"?

@leon-thomm
Copy link
Contributor

pythonocc-core is a prerequisite (or dependency), along with pythonocc-utils, anaconda, and ryven. if you want to use this project (Pythonocc-nodes-for-Ryven), you have to download it too, i.e. clone the repository via git clone https://github.com/Tanneguydv/Pythonocc-nodes-for-Ryven

@WillAdams
Copy link
Author

I guess the thing which I'm missing here is the difference between just using python at the terminal, using anaconda, and the difference in accessing one or the other.

Is there a set of step-by-step instructions, which assume nothing, for installing on Linux?

What happened to the pythonocc.org website?

@leon-thomm
Copy link
Contributor

yeah, I don't know if there are more detailed instructions for PythonOCC, but you will find plenty of resources online which take you through the process of installing the Anaconda platform, setting up a new conda environment, and then installing packages in this environment, which is what you need.

@leon-thomm
Copy link
Contributor

leon-thomm commented Jan 18, 2022

and to prevent confusion: you can have (and usually do have) various Python installations on your system, and Anaconda will also bring its own Python installation. So, yes when using PythonOCC you are using Python, but you use it inside an Anaconda environment

@Tanneguydv
Copy link
Owner

Tanneguydv commented Jan 18, 2022

Once everything installed you can create a .bat file with this text :

call activate pyoccryv3env
ryven
pause

where pyoccryv3env is the virtual environment you have setup to run Ryven with PythonOCC
Then create a shortcut of this .bat file to havae easy access to Ryven.

Personnaly I use Miniconda instead of Anaconda, and I use Pycharm to easily access virtual environnement and code in a python friendly IDE

You can find all ressources on PythonOCC from this link :https://github.com/tpaviot/pythonocc-core

@WillAdams
Copy link
Author

WillAdams commented Feb 2, 2022

The problem seems to be that I can't get a working nodes.py loaded.

I've downloaded and unzipped: https://github.com/Tanneguydv/Pythonocc-nodes-for-Ryven/archive/refs/heads/main.zip

and if I point it at:

image

it won't press

and if I point it at:

image

get:

image

and if both:

image

(base) C:\Users\willa>ryven
importing packages...
Traceback (most recent call last):
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\Scripts\ryven.exe_main
.py", line 7, in
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\lib\site-packages\ryven\main\Ryven.py", line 75, in run
editor = MainWindow(editor_init_config, window_title, window_theme, flow_theme, parent=gui_parent)
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\lib\site-packages\ryven\gui\main_window.py", line 77, in init
self.import_packages(config['required packages'])
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\lib\site-packages\ryven\gui\main_window.py", line 324, in import_packages
self.import_nodes(p)
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\lib\site-packages\ryven\gui\main_window.py", line 334, in import_nodes
nodes = import_nodes_package(p)
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\lib\site-packages\ryven\main\utils.py", line 48, in import_nodes_package
load_from_file(package.file_path)
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\lib\site-packages\ryven\main\utils.py", line 19, in load_from_file
mod = spec.loader.load_module(name)
File "", line 548, in _check_name_wrapper
File "", line 1063, in load_module
File "", line 888, in load_module
File "", line 287, in _load_module_shim
File "", line 619, in _exec
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "C:\Users\willa\Desktop\Xtensions\Pythonocc-nodes-for-Ryven-main\nodes.py", line 3, in
widgets = import_widgets(file)
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\lib\site-packages\ryven\NENV.py", line 81, in import_widgets
load_from_file(abs_path)
File "C:\Users\willa\AppData\Local\Programs\Python\Python310\lib\site-packages\ryven\main\utils.py", line 19, in load_from_file
mod = spec.loader.load_module(name)
File "", line 548, in _check_name_wrapper
File "", line 1063, in load_module
File "", line 888, in load_module
File "", line 287, in _load_module_shim
File "", line 619, in _exec
File "", line 879, in exec_module
File "", line 1016, in get_code
File "", line 1073, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\willa\Desktop\Xtensions\Pythonocc-nodes-for-Ryven-main\widgets.py'

@Tanneguydv
Copy link
Owner

I think that your installation of Ryven does not belong to the virtual environment created with OCC installation, that's why the module OCC can't be found while launching Ryven I guess.
At the installation of OCC you created a virtual env (named such as pyoccenv), you have to install Ryven in this same virtual environment (conda activate pyoccenv then pip install ryven)

@leon-thomm
Copy link
Contributor

@Tanneguydv what is the difference between the two nodes files? there should only be one in PythonOCC/

@Tanneguydv
Copy link
Owner

There's only one node file, no?

@leon-thomm
Copy link
Contributor

leon-thomm commented Feb 2, 2022

repo/nodes.py
https://github.com/Tanneguydv/Pythonocc-nodes-for-Ryven/blob/main/nodes.py
repo/PythonOCC/nodes.py
https://github.com/Tanneguydv/Pythonocc-nodes-for-Ryven/blob/main/PythonOCC/nodes.py
which caused some confusion above, there should only be 1, the files are identical

#14

@Tanneguydv
Copy link
Owner

My Bad, I'll fix this

@Tanneguydv
Copy link
Owner

removed, I closed your pull request, thank you!

@WillAdams
Copy link
Author

WillAdams commented Feb 3, 2022

Okay, the command:

source activate pyoccenv

from: https://github.com/tpaviot/pythonocc-core doesn't seem to work --- instead used:

conda activate pyoccenv

Also, python can't equal 3.10

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

3 participants