GithubHelp home page GithubHelp logo

mahmoudabdelrahman / gh_cpython Goto Github PK

View Code? Open in Web Editor NEW
173.0 33.0 37.0 7.45 MB

CPython plugin for Rhino-Grasshopper

License: BSD 2-Clause "Simplified" License

C# 52.89% Python 47.11%
grasshopper gh-cpython python cpython

gh_cpython's Introduction

Anouncemet 🎤 This project is no longer maintained 🎈📆💔.

###To use CPython in Grasshopper, we refer to Gh Python Remote

DOI alpha

python_logo-100

GH_CPython

CPython plugin for Grasshopper.

Please cite as :

@misc{AbdelRahman2017,
abstract = {CPython plugin for grasshopper},
author = {AbdelRahman, Mahmoud},
doi = {10.5281/ZENODO.888148},
title = {{GH{\_}CPython: CPython plugin for grasshopper}},
url = {https://doi.org/10.5281/zenodo.888148},
year = {2017}
}

Mahmoud Mohamed Abdelrahman. (2017). Gh_CPython: CPython plugin for grasshopper. https://doi.org/10.5281/zenodo.888148

ghcpythonposter2

image


DOI: 10.13140/RG.2.2.27230.33600/1

The Idea of this plugin is to provide a component that implements CPython codes inside grasshopper.

  • It is pereferred that you download one of the bundles that include all the required python scientific libraries such as Python(x,y), Anaconda or Canopy
  • You have to run Rhino as adminstrator at first.

The following image shows CPython plugin(down right) , and the first implemented plugin (top right) and the code ide (left) firstplugin

plgn

Add description, documentation to each input and output documentations

image

Supports any version on Python. 2.7, 3.4, 3.5, 3.6 .. image

How to choose between different Python interpreters?

By clicking on the thin blue line at the bottom of any component, a new window will popup and you can choose your preferred interpreter from this window. 221

What can and What can't it do?

It can:

  1. Add as many input and output variables as needed.
  2. Change its name, NickName and discription.
  3. Import all CPython modules such as numpy, scipy, matplotlib, sympy, etc..
  4. Change Icon (simply drag a 24x24 pixel image to the component).
  5. Save as user object.
  6. Create Rhino Geometry (in progress)

01 02 04 06

GhPython Vs. Gh_CPython

speedtest

License

BSD 2-Clause License

This project has been started by: Mahmoud M. Abdelrahman

<arch.mahmoud.ouf111[at]gmail.com>

Copyright (c) 2017, Mahmoud AbdelRahman

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

gh_cpython's People

Contributors

dantaeyoung avatar johannesrave avatar mahmoudabdelrahman avatar mrtnbrst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gh_cpython's Issues

SyntaxError: Missing parentheses in call to 'print'. Did you mean print(allLines[5])?

I got the following error following the simple demo code as shown on GitHub for the GH_CPython component. May I ask why this error is related to the print function which I didn't use at all?

Traceback (most recent call last):
  File "C:\GH_CPython\PythonFileWritten_2.py", line 36, in <module>
    import Grasshopper as gh
  File "C:\GH_CPython\Grasshopper.py", line 99
    print allLines[5]
                 ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(allLines[5])?

The code is here:


""" 
Python Script
Created on  Wednesday October 2020 01:09:39 
@author:  AAA 

[desc]
Description of the plugin Here
Write here any thing... 
[/desc]

ARGUMENTS:
----------
<inp> 
    _input :[required] - [type = int] - [default = None] 
    Descripe your input here 
        * bullet point.
        * bullet point
</inp>
<inp>
    Other inputs go here ...
</inp>

RETURN:
----------
    <out>
        output_ : indicate your output description here. \n refers to a new line.
        a : 
        b : 
    </out>

"""

import Grasshopper as gh

output_ = gh.addPoint(0, 4, 2)
a = gh.addPoint(-5, 10, 0)

p1 = gh.Point(0, 0, 0)
p2 = gh.Point(5, 5, 5)

b = gh.addLine(p1, p2)

last line: "print __name__"

Hello Mahmoud!
You forgot the paranthesis in the print statement in the last line ;p the Grasshopper ( 02 ? ) module can't be imported.
Outstanding initiative, by the way! Thank you so much! I'll try to catch up with the know-how and maybe help in the near future :D

image

edit: same for line 155: print "you have to create surface from 4 points"

Plugin not working

Hi Mahmoud,

I have some problems with the component, I did as instructed in the wiki; placing the .gha and the .dll inside ./Libraries. I also ran Rhino as admin. The component appears on my component tab but it won't run anything. Also, File>Open and Save as doesn't open a window.

Clicking test only updates the 'successful in _ ...' part.

I've tried Py 2.7, 3.5 and 3.6. Could you help me? Thanks in advance!
2

Btw, I was also wondering what the little green box was for.
Looks like this is going to be my new favorite plugin :)

GH_CPython does not save codes.

Dear Mahmoud,

GH_CPython does not save codes. I know you already fixed bugs in the input parts. Bugs in saving codes also need your care.

Thanks.
Jihoon

Request: Python 3 support

Hi Mahmoud,

Thanks for the amazing progress! I was wondering if it is possible to add as a future goal Python 3 support.

This is not that critical since the workflows are still completely fine, but I feel a lot of DL libraries are moving to Python 3 support (only?) slowly.

Kind regards,
Theodore.

Keyboard shortcut for Test

Feature request: Do you think you could implement the 'F5' keyboard shortcut for testing that's in GHPython already? It's a very helpful feature that can make the editor feel a bit more like a REPL.

Thank you!!

ModuleNotFoundError: No module named 'numpy'

Hi,
Thank you very much for this awesome work!
I have installed Anaconda on my computer and launched Rhino as Administrator. When I try to import numpy, CPython shows an error not fiding 'numpy'.
I'd appreciate if you could help me here.
Thank you

Send Dataframe from one component to another

Hi there!

I am running Pandas to read an .xlsx file into GH_CPython. As this process is quite slow, I want to do it once and then send the imported Dataframe to other GH_CPython components. However, everytime I connect the output with the input, it crashes.

I have tried 'hiding' the Dataframe in a class. The program doesn't crash, but it doesn't see the Dataframe either.

Is there any way I can send a Dataframe to other components?

Thanks a lot!

c:/GH_CPython on shared/lab environments - not working

Hi,

Do you think you can compile and release a version where the 'temp' interpreter files are not on C: but on a "USER"\Desktop\GH_CPython?

On windows lab servers writing on C: or even having separate 'virtual' folder directly on C is not going to work.
If you change the path to be inside the USERS personal folder it would be amazing.

Thanks

New Features Added

New Features have been added including:

  1. Creating user objects
  2. Adding documentation to each input and output
    features

Is it possible to input a numpy matrix?

Hi,

Is it possible to input a numpy matrix and use numpy.asmatrix to cast input as numpy matrix? What I am trying to do it use one CPython component to read a big binary file as matrix then use the second CPython component to get information out of the matrix. By using two component, i think I could avoid the slow process of reading the file every time a variable changes.

Another question is how to input a file path? Can you give an example? I tried a couple of ways but did not manage to get it to work. Many thanks.

Issues with Anaconda environment as python interpreter

Hi,

Thanks for the great work on this! It seems to me that it should be possible to use this with Anaconda, however, when I set a custom interpreter and try to import numpy, I receive this error:

C:\Users\USERDIR\.conda\envs\cpython36\lib\site-packages\numpy\__init__.py:140: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
  from . import _distributor_init
Traceback (most recent call last):
  File "C:\Users\USERDIR\.conda\envs\cpython36\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
    from . import multiarray
  File "C:\Users\USERDIR\.conda\envs\cpython36\lib\site-packages\numpy\core\multiarray.py", line 14, in <module>
    from . import overrides
  File "C:\Users\USERDIR\.conda\envs\cpython36\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\GH_CPython\PythonFileWritten_2.py", line 33, in <module>
    import numpy
  File "C:\Users\USERDIR\.conda\envs\cpython36\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import core
  File "C:\Users\USERDIR\.conda\envs\cpython36\lib\site-packages\numpy\core\__init__.py", line 54, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.6 from "C:\Users\USERDIR\.conda\envs\cpython36\python.exe",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.18.1" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: DLL load failed: The specified module could not be found.

(Please note that I replaced my user directory in the paste above)

Opening the environment in a CLI and importing numpy from there works without any problems.
One user reported #39 that reinstalling the numpy package solved the issue for him but that, unfortunately, doesn't work for me.
Is there anything I can do to get this running with Anaconda?

Best,

Patrick

Installation

Hi Mahmoud,

first of all, thank you very much for developing this, as it has been a missing component from GH. I just want to ask you about the installation process. Is it a simple copy of the gha into the libraries folder?

The component is visible in my tooldbar, but whenever I try to run any code, the process freezes and Rhino crashes.

Any advise will be much appreciated.

I have several python tools that run outside Grasshopper that I would like to implement and some of them run using Pandas module. Do you think this is something that will be stable enough in the environment you are building?

Thank you very much,
-Byron

Output splits strings with commas

Dear Mahmoud,

Congratulations on making this component!
However, I have come across a problem when outputing strings: they are split at the commas. (image below)

Do you know what is happening here?

gh_cpython_string_error

All the best,

Rui

Problem no encoding declared

Hello!
when i restart the grasshopper,it always has the problem:
File "C:\GH_CPython\PythonFileWritten_1.py", line 1
SyntaxError: Non-ASCII character '\xe2' in file C:\GH_CPython\PythonFileWritten_1.py on line 1, but no encoding declared
However,# -- coding: utf-8 -- has been in line1
Thanks!

How can I use "ghenv.Component" ?

Hi!
I want to get iterative outputs by using "ghenv.Component.ExpireSolution(True)" as follows:

http://www.grasshopper3d.com/forum/topics/loops-in-gh-python (py_loop.gh)

In GH_Python, such script would walk fine and outputs are recomputed in each iterations.
However, In GH_CPython, I recieved this message: AttributeError: 'fileInfo' object has no attribute 'Component'

Is it possible to use "ghenv.Component.ExpireSolution(True)" in the current version of GH_CPython?

Strange error on parameter *input*

Hi @MahmoudAbdelRahman! I'm here with another error. Thanks for being so open to feedback!

I'm trying to receive strings and multi-line strings as inputs, but am getting a curious error. My use-case is to input a multi-line string into GH_CPython and to have it in a variable as a multi-line string, but GH_CPython seems to be doing some internal stuff that affects how things are being processed.

Specifically, I'm working with LispHopper so I can input a string such as (print "hello") and everything handled and characters escaped properly and placed in a variable in GH_CPython.

Example below:
http://imgur.com/OvQaJ0B.jpg

Thanks!

Default values for inputs

What a great plugin!
I was wondering though if there is a way of setting the default values for the inputs?
Many thanks,
N/

Outdated compiled files in zip

Hello,
Could you please reupload a new zip file here and to food4rhino as the ones that are published still have at least one issue that you have resolved in the source files.
Specifically I am talking about this one - #44 , as I have encoutared it too and corrected my local C:/GH_CPython/Grasshopper.py myself. When I checked it here - I found that you had already made the change in the source files, but the new version is not usable as a distributable.

New inputs are named c instead of z

This is not a bug but is more of an enhancement.

image

When I add a new input I expect it follows the x, y, z order but it names the new input as c.

Cpython input precision

hi!
there is some kind of bug in the input precision.
here is an example with PI
2017-10-19 00_25_35-gh_cpython
you can have more precision when you import string in Cpython than a simple number (the string here is before converted with a basic python script)
2017-10-19 00_47_03-gh_cpython

input parameter and editing window issue

Dear Mahmoud,

Adding input parameter such as 'x' without assigning data to it makes me unable to open the editing window of GH_CPython. I am not sure if it is a kind of bug or another issue.

Best regards,

Jihoon

Input and output variables

Thanks for this valuable development.

Please note the error shown on the following image.

Can the component accept input? How can I use input part with text, number, geometry and so on? Please note the error message on the python test window.

20170719 001

I also found output variable did not work. The panel should show 100 if the component works.

20170719 002

Would you show me how to handle input and output variables? If input and output variable parts are under development, a couple of basic types can be used in stead of all types of objects until the development is completed.

Thanks in advance.

Jihoon

[BUG] Invalid syntax caused by spaces in function name

Traceback (most recent call last):
File "C:\GH_CPython\PythonFileWritten_1.py", line 1, in
exec('output_ = None\n_input = Referenced Mesh (V:152257 F:50991) \n\nclass fileInfo:\n def init(self):\n self.filePath = "E:/ZJJ/地形分区快/unnamed.gh"\n self.fileName = "unnamed"\nghenv = fileInfo()\n\n\n')
File "", line 2
_input = Referenced Mesh (V:152257 F:50991)
^
SyntaxError: invalid syntax

image

Importing the numpy c-extensions failed

Importing the numpy c-extensions failed.
Strangely this works on my laptop, but on the PC I cannot solve this.
I have anaconda python 3.6 installed with all the modules. These work in Jupyter Notebook for example, but not in GH.

1. Traceback (most recent call last):
  File "C:\Users\Mateusz\Anaconda3\envs\gh36\lib\site-packages\numpy\core\__init__.py", line 17, in <module>
    from . import multiarray
  File "C:\Users\Mateusz\Anaconda3\envs\gh36\lib\site-packages\numpy\core\multiarray.py", line 14, in <module>
    from . import overrides
  File "C:\Users\Mateusz\Anaconda3\envs\gh36\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ImportError: DLL load failed: Nie można odnaleźć określonego modułu.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\GH_CPython\PythonFileWritten_5.py", line 3, in <module>
    from sklearn.externals import joblib
  File "C:\Users\Mateusz\Anaconda3\envs\gh36\lib\site-packages\sklearn\__init__.py", line 74, in <module>
    from .base import clone
  File "C:\Users\Mateusz\Anaconda3\envs\gh36\lib\site-packages\sklearn\base.py", line 17, in <module>
    import numpy as np
  File "C:\Users\Mateusz\Anaconda3\envs\gh36\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import core
  File "C:\Users\Mateusz\Anaconda3\envs\gh36\lib\site-packages\numpy\core\__init__.py", line 47, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.6 from "C:\Users\Mateusz\Anaconda3\envs\gh36\python.exe",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.17.4" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: DLL load failed: Nie można odnaleźć określonego modułu.


Problem to output string array

Just got a problem to output string array. Each single array is in single quotes.
test become 'test'.
I also have a problem to output "[" in a string array. It just disappeared. "{" and "(" works but not "[".
Any suggestions?

Is GH_CPython compatible with Rhino 6 ?

Hi @MahmoudAbdelRahman ,

Thank you for this pluggin.

One question, is it compatible with Rhino 6 ?

I have followed the instructions from the wiki (.gha and .dll files in library folder + open Rhino as administrator) but:

  • no dialogue box appears when opening Grasshopper
  • GH_CPython component doesn't appear in Maths>Scripts either.

The only dialogue box that I have is when I double-click on .gha file directly from the library folder, Rhino opens and displays the following message

ss211

Is it just me or a Rhino 6 compatibility issue ?

GH_CPython not working

Hi Mahmoud

I installed gh_cpython according to the wiki and connected with python3.6 but it doesn't work. I would appreciate it if you could tell me the solution. Thank you.

スクリーンショット 2021-11-19 101943
スクリーンショット 2021-11-19 102243

Item and Tree input creates a tree output for the Item input

Great work,
i try to create a exelsheet manipulator with pandas etc. at it works.
The only problem is the input and output of your cpython node.
Input:
Tree with branches
Item with one string
Output
Tree with branches
Tree with branches Item in each branch
If i print the input everything looks fine and its seams not possible to change the output to item because the manage data ouptput in your cpython node is emtpy only input shows correct.

unbenannt

I really hope you keep on going develope the cpython plugin it works phantastic.
Again great work

Tree input data structure not parsing corectly for PythonFileWritten.py

Hello again! :D

I've been trying to understand the whole source code more, for a more useful feedback, but I can't seem to find how the "C:\GH_CPython\PythonFileWritten.py" temporary file is getting its input data, and more importantly, how is that input data parsed.

Maybe I have something outdated, not sure, but this is what I'm getting for each data acces type, in 2 different cases:

1 ) when I input a flattened tree (so just a list, basically) - no errors, but there are discrepancies which require to create an additional string parser on the grasshopper canvas in order to further process the output and make it look like the IronPython outputs

image

2 ) when I input an actual tree - I get errors when I set data acces type to either tree or list

image

In the end, I'm guessing that the goal is for the 6 white panels in the center of the screenshot to have the exact same output, and the yellow panels on the left ( from IronPython's print(x) ) is giving some clues about how to do it.

From what I can understand from the runtime error (extracted with some MetaHopper components), the PythonFileWritten.py is receiving wrong parsed input data:
x = '[0.0,1.0,2.0,,3.0,4.0,,5.0,6.0]'
Instead of the double comma ",," that separates the list (/branch) in a list of lists (/tree), I'm guessing it should have the closing parantheses and a single comma, like "],[", AND have an extra pair of parantheses
at the ends of the string, making the parsed string look like an actual list of lists, like this:
x = '[[0.0,1.0,2.0],[3.0,4.0],[5.0,6.0]]'
In case I missed an update, or updating incorrectly, I'm sorry for the long post. :)) If not, I hope this was helpful enough, without finding where in the source code this is actually happening. :p

Here is the gh file in case you want the template:
DataAcces_comparison.zip

os: Windows 10
interpreter: Python 3.6

Copy paste from Notepad++

i've got a small bug when i copy paste from notepad++

_c__users_g meunier_google drive_github_ecosphere_gh_pymap3d_basic py - notepad _2017-08-07_16-51-18

it's pasted with too many spaces

gh_cpython_2017-08-07_16-56-56

and it says "IndentationError: unindent does not match any outer indentation level"
If i delete the spaces from line "x,y,z" and then press enter it's then working

Python (SPYDER) Import modules

Hi, I've just tried to import numpy or matplotlib in grasshopper with GH_CPython.
I have Spyder 3 (ANACONDA), Python standalone, Microsoft Visual studio.
My operating system is Windows 10.

It gives me a long errors messages and gives me some advise like:

  1. D:\anaconda3\lib\site-packages\numpy_init_.py:140: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
    "

from . import distributor_init
Traceback (most recent call last):
File "D:\anaconda3\lib\site-packages\numpy\core_init
.py", line 24, in
from . import multiarray
File "D:\anaconda3\lib\site-packages\numpy\core\multiarray.py", line 14, in
from . import overrides
File "D:\anaconda3\lib\site-packages\numpy\core\overrides.py", line 7, in
from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\GH_CPython\PythonFileWritten_6.py", line 24, in
import numpy as np
File "D:\anaconda3\lib\site-packages\numpy_init_.py", line 142, in
from . import core
File "D:\anaconda3\lib\site-packages\numpy\core_init_.py", line 54, in
raise ImportError(msg)
ImportError:

"

So, I don't knwo how can I figure out this issue! My goal is be able to use the whole python libraries on Grasshopper.

Thanks!

Problem with GH_CPython and Eppy run command

Good morning,
I wrote a code to run energy analysis from Python 3.8 in Spyder (Anaconda3) and it works. In a few words, my code modifies the idf file (the file used for the energy analysis) and then launches the analysis in an external software (EnergyPlus). I was trying to use this code in grasshopper using GH_CPython code (with this path C:\Users\Pc\anaconda3\python.exe) but I'm facing different problems, it would be great to have help from you.

I have created a rhinoremote environment and imported all the scripts needed for my Python code (Eppy which is installed in anaconda) and the code seems to work if I modify my .idf file or save it. But if I try to launch the analysis it doesn't work, find attached the error.

C:\Users\Pc\anaconda3\lib\site-packages\numpy_init_.py:140: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
from . import _distributor_init
Traceback (most recent call last):
File "C:\GH_CPython\PythonFileWritten_1.py", line 27, in
idf.run(readvars=True, expandobjects=True,output_directory=os.path.join(folderpath,"Output"))
File "C:\Users\Pc\anaconda3\lib\site-packages\eppy\modeleditor.py", line 1009, in run
self.saveas("in.idf")
File "C:\Users\Pc\anaconda3\lib\site-packages\eppy\modeleditor.py", line 974, in saveas
self.save(filename, lineendings, encoding)
File "C:\Users\Pc\anaconda3\lib\site-packages\eppy\modeleditor.py", line 947, in save
with open(filename, "wb") as idf_out:
PermissionError: [Errno 13] Permission denied: 'in.idf'

Drag&drop icon feature not working

In the wiki it says you can change node's icon by drag&dropping 24x24px PNG file. I tried but it doesn't change. Does that feature work in Rhino7?

Input access type

Currently the input access is set to list and doesn't seem to be possible to change it.

Accessing GH file location in GH_CPython?

Hi @MahmoudAbdelRahman , thanks for such a wonderful project - really excited to have 'real' Python in Grasshopper.

Is there a good way to access the GH file location from within GH_CPython?

I'd like to write some Python in the same directory as the .gh file and import those files. However, os.path.dirname(os.path.realpath(__file__)) is returning C:\Gh_CPython.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.