見出し画像

Rhino8のGrasshopperでopenseespyを使いたい

概要

Rhino 8 ではgrasshopper のpythonが3系になり、script editorで外部のライブラリが使用可能になったので、openseespyを使ってみようとしてつまづいた部分の自分用メモ。

実施したRhinocerosのバージョン:
Rhino 8 for Windows
8.9.24194.18121 | 2024年7月12日 

Grasshopper Script EditorでPython 3系を使用する

Rhino 8 から使用可能になったScript Editor

Python のバージョンは3.9.10。

最初にやって、うまくいかなかったこと

最初は、以下のサイトなどに記載の記法(# r: numpy や# venv: site-packagesなどを直接記入)を試していたが、原因不明のエラーが多かったのでやめた。これに限らず、パッケージインストール時などに、(パッケージ名のスペルミスなどで)とにかく頻繁にエラーが出る。出たらRhino再起動が必要な場合が多い。それでも解決しなければ、Rhino 8の再インストールが必要っぽい。

再インストール時には、以下のフォルダなども削除した。(関係あるかはよくわからない)
C:\Users\owner\.rhinocode
C:\Users\owner\AppData\Local\McNeel\Rhinoceros\8.0
C:\Users\owner\AppData\Roaming\McNeel\Rhinoceros\8.0

行った試行錯誤

ライブラリのパッケージインストールには、Script Editor上のメニュー中の段ボールのアイコンをクリックし、パッケージ名を入力してインストールすればよい(本来の正攻法)。

numpy,scipy,pandas,matplotlibなどは問題なくできた。


しかしopenseespyは失敗。pythonのバージョンが3.9.10なのが問題っぽい(2024年7月現在の最新openseespyはpython3.11に適合)。
しかし以下のポストによると、Rhino 8 のpythonのバージョンアップはまだ先。

python 3.9.10で利用可能なopenseespyのバージョンがわからない。chatGPTに聞いてみると、下記の回答。

For Python 3.9.10, you can use OpenSeesPy version 3.2.2.1. This version has been confirmed to be compatible with Python 3.9, ensuring you can run OpenSeesPy without issues related to Python version mismatches. Be sure to check that you're installing the correct version to avoid compatibility issues. You can typically do this via pip by specifying the version number during the installation process. For further details on OpenSeesPy compatibility, you might want to check sources like the PyPI repository or the project's GitHub issues where compatibility discussions often occur.

ためしにopenseespy 3.2.2.1を指定すると、ひとまずインストールできた。

しかし実行すると、以下の表示のエラーが出た。openseespy 3.2.2は古すぎた?3.2.2.1が3.2.2になっているし。

以下のリンク先などによると、openseespy 3.5.1.3からはpython 3.10が、openseespy 3.5.1.8からはpython 3.11.が必要ということは確認できたものの、python 3.9.10に合うのは openseespy 3.3.0から3.5.1.3までのどれかっぽいというところまでで、これ以上はよくわからない。

Script Editorでopenseespy<=3.5.1.2を指定しDLても、以下のエラーが出る。3.5.1.2と指定しているのに以下のエラー中では3.5.1の指定と認識されてしまうのもよくわからない。

Info 07/25/2024 19:08:06 [RhinoCode] Installing "openseespy<=3.5.1"
Info 07/25/2024 19:08:06 [RhinoCode] Running process: C:\Users\owner\.rhinocode\py39-rh8\python.exe -s -m pip --disable-pip-version-check install --target "C:\Users\owner\.rhinocode\py39-rh8\site-envs\default-qIXuajZd" --progress-bar off --upgrade --no-warn-script-location --retries 0 --timeout 1 "openseespy<=3.5.1"
Error 07/25/2024 19:08:08 [RhinoCode] Process exited with code 2
Error 07/25/2024 19:08:08 [RhinoCode] pip install error | Collecting openseespy<=3.5.1
  Using cached openseespy-3.4.0.8-py3-none-any.whl.metadata (1.6 kB)
Collecting openseespywin>=3.4.0.8 (from openseespy<=3.5.1)
  Downloading openseespywin-3.4.0.8-py3-none-any.whl.metadata (1.0 kB)
Downloading openseespy-3.4.0.8-py3-none-any.whl (4.2 kB)
Downloading openseespywin-3.4.0.8-py3-none-any.whl (5.8 MB)

ERROR: Exception:
Traceback (most recent call last):
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher
    yield
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_vendor\urllib3\response.py", line 561, in read
    data = self._fp_read(amt) if not fp_closed else b""
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_vendor\urllib3\response.py", line 527, in _fp_read
    return self._fp.read(amt) if amt is not None else self._fp.read()
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 98, in read
    data: bytes = self.__fp.read(amt)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\http\client.py", line 463, in read
    n = self.readinto(b)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\http\client.py", line 507, in readinto
    n = self.fp.readinto(b)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\socket.py", line 704, in readinto
    return self._sock.recv_into(b)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_internal\cli\base_command.py", line 179, in exc_logging_wrapper
    status = run_func(*args)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_internal\cli\req_command.py", line 67, in wrapper
    return func(self, options, args)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_internal\commands\install.py", line 377, in run
    requirement_set = resolver.resolve(
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 179, in resolve
    self.factory.preparer.prepare_linked_requirements_more(reqs)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_internal\operations\prepare.py", line 554, in prepare_linked_requirements_more
    self._complete_partial_requirements(
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_internal\operations\prepare.py", line 469, in _complete_partial_requirements
    for link, (filepath, _) in batch_download:
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_internal\network\download.py", line 184, in __call__
    for chunk in chunks:
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_internal\network\utils.py", line 63, in response_chunks
    for chunk in response.raw.stream(
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_vendor\urllib3\response.py", line 622, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_vendor\urllib3\response.py", line 587, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\owner\.rhinocode\py39-rh8\lib\site-packages\pip\_vendor\urllib3\response.py", line 443, in _error_catcher
    raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.



Error 07/25/2024 19:08:08 [RhinoCode] Error installing package | Rhino.Runtime.Code.Environments.EnvironException: Exception:

   at Rhino.Runtime.Code.Languages.PythonNet.CPythonEnviron.AddPackages(IEnumerable`1 pkgSpecs, IProgress`1 progress)
   at Rhino.Runtime.Code.Environments.Environ`1.Rhino.Runtime.Code.Environments.IPackageEnviron.AddPackages(IEnumerable`1 pkgSpecs, IProgress`1 progress)
   at RhinoCodeEditor.Editor.Dialogs.InstallPackageDialog.<>c__DisplayClass16_0.<InstallPackages>b__0()

バージョン番号について、Script editorで上から3桁までの数値しか反映されないのは仕様かもしれない(以下のセマンティックバージョニングのメジャーバージョン・マイナーバージョン・パッチバージョン)


結局、openseespy<=3.4.0 を指定してDLすると、とりあえず動いた。openseespy-3.3.0.1.1とopenseespywin-3.4.0.8 が入ったっぽい。


Info 07/25/2024 19:14:51 [RhinoCode] Installing "openseespy<=3.4.0"
Info 07/25/2024 19:14:51 [RhinoCode] Running process: C:\Users\owner\.rhinocode\py39-rh8\python.exe -s -m pip --disable-pip-version-check install --target "C:\Users\owner\.rhinocode\py39-rh8\site-envs\default-xPtdn4Hi" --progress-bar off --upgrade --no-warn-script-location --retries 0 --timeout 1 "openseespy<=3.4.0"
Info 07/25/2024 19:14:51 [RhinoCode] Running process: C:\Users\owner\.rhinocode\py39-rh8\python.exe -s -m pip --disable-pip-version-check list --path "C:\Users\owner\.rhinocode\py39-rh8\site-envs\default-xPtdn4Hi" --format freeze
Info 07/25/2024 19:14:52 [RhinoCode] Collecting openseespy<=3.4.0
  Using cached openseespy-3.3.0.1.1-py3-none-any.whl.metadata (1.6 kB)
Collecting openseespywin>=3.3.0.1 (from openseespy<=3.4.0)
  Using cached openseespywin-3.4.0.8-py3-none-any.whl.metadata (1.0 kB)
Using cached openseespy-3.3.0.1.1-py3-none-any.whl (128 kB)
Downloading openseespywin-3.4.0.8-py3-none-any.whl (5.8 MB)
Installing collected packages: openseespywin, openseespy
Successfully installed openseespy-3.3.0.1.1 openseespywin-3.4.0.8


Script editorに以下のopenseespy例題コードを入力し、解析できたことを確認した。
https://openseespydoc.readthedocs.io/en/latest/src/truss.html

"""Grasshopper Script"""
# requirements: numpy
# requirements: scipy
# requirements: matplotlib
# requirements: openseespy<=3.4.0

from openseespy.opensees import *

import numpy as np
import matplotlib.pyplot as plt

# ------------------------------
# Start of model generation
# -----------------------------

# remove existing model
wipe()

# set modelbuilder
model('basic', '-ndm', 2, '-ndf', 2)

# create nodes
node(1, 0.0, 0.0)
node(2, 144.0,  0.0)
node(3, 168.0,  0.0)
node(4,  72.0, 96.0)

# set boundary condition
fix(1, 1, 1)
fix(2, 1, 1)
fix(3, 1, 1)

# define materials
uniaxialMaterial("Elastic", 1, 3000.0)

# define elements
element("Truss",1,1,4,10.0,1)
element("Truss",2,2,4,5.0,1)
element("Truss",3,3,4,5.0,1)

# create TimeSeries
timeSeries("Linear", 1)

# create a plain load pattern
pattern("Plain", 1, 1)

# Create the nodal load - command: load nodeID xForce yForce
load(4, 100.0, -50.0)

# ------------------------------
# Start of analysis generation
# ------------------------------

# create SOE
system("BandSPD")

# create DOF number
numberer("RCM")

# create constraint handler
constraints("Plain")

# create integrator
integrator("LoadControl", 1.0)

# create algorithm
algorithm("Linear")

# create analysis object
analysis("Static")

# perform the analysis
analyze(1)

ux = nodeDisp(4,1)
uy = nodeDisp(4,2)
if abs(ux-0.53009277713228375450)<1e-12 and abs(uy+0.17789363846931768864)<1e-12:
    print("Passed!")
    print("ux,uy=",ux,uy)
else:
    print("Failed!")


ただし、ここで使用されたopenseespy 3.3.0.1.1は、比較的最近追加されたメソッド(openseespy.opensees.meshなど)が利用できない。現時点ではgrasshopper script editor側で利用可能なpythonが古いため、どうしようもなさそう。
例えば、以下の現在検討中のコード(普段はJupyterNotebookではpython3.11+openseespy 3.5.1.12 openseespywin 3.5.1.12 で実行)を実行しようとすると、ops.meshの行でエラーが出る。

import numpy as np
import scipy.linalg as splin
import matplotlib.pyplot as plt
import openseespy.opensees as ops

ops.wipe()
# +===============================================================================+
# |                                   Units                                       |
# +===============================================================================+
m, kN, sec = 1.0, 1.0, 1.0  # meter for length, kilonewton for force, second for time
# Angle
rad = 1.0
deg = np.pi/180.0*rad
# Length, Area, Volume, Second moment of area
m2, m3, m4 = m**2, m**3, m**4
cm, cm2, cm3, cm4 = m*1E-2, m*1E-4, m*1E-6, m*1E-8
mm, mm2, mm3, mm4 = m*1E-3, m*1E-6, m*1E-9, m*1E-12
inch, ft = 0.0254*m, 0.3048*m
# Force
N = kN*1E-3
g = 9.80665*m/(sec**2)
# Mass
kg = N*sec**2/m
ton = kg*1E3
lbs, kip = 0.45359237*kg, 453.59237*kg
# Pressure
Pa, kPa, MPa, GPa = N/m**2, 1E3*N/m**2, 1E6*N/m**2, 1E9*N/m**2
pcf, ksi = lbs/(ft**3), kip/(inch**2)
psi = ksi/1E3

Inf = 1.0E12  # a really large number
Null = 1/Inf  # a really small number
LunitTXT = "m"  # (Length) define basic-unit text for output
FunitTXT = "kN"  # (Force) define basic-unit text for output
TunitTXT = "seconds"  # (Time) define basic-unit text for output

# +===============================================================================+
# |                            Define some functions                              |
# +===============================================================================+

def make_model_ecc():
    ops.wipe()
    ops.model('basic','-ndm',3,'-ndf',6)

    ops.node(1,0.,-B/2.0,0.); ops.fix(1, *[1,1,1,1,0,1])
    ops.node(2,0.,B/2,0.); ops.fix(2, *[1,1,1,1,0,1])
    ops.node(3,L,-B/2,0.);
    ops.node(4,L,B/2,0.0001);
    ops.node(5,L,-B/2,ratio*ethick); ops.fix(5, *[0,1,1,1,0,1])
    ops.node(6,L,B/2,-(1.0-ratio)*ethick); ops.fix(6, *[0,1,1,1,0,1])
    
    # plate
    #mesh('line', tag, numnodes, *ndtags, id, ndf, meshsize, eleType='', *eleArgs=[])
    #counterclockwise!
    ops.mesh('line',1, 2, *[1,3], 0, 6, msizeL)
    ops.mesh('line',2, 2, *[3,4], 0, 6, msizeB)
    ops.mesh('line',3, 2, *[4,2], 0, 6, msizeL)
    ops.mesh('line',4, 2, *[2,1], 0, 6, msizeB)
    
    #nDMaterial('ElasticIsotropic', matTag, E, nu, rho=0.0)
    ops.nDMaterial('ElasticIsotropic',2,E,0.0)
    #nDMaterial('PlateFiber', matTag, threeDTag)
    ops.nDMaterial('PlateFiber',601,2)
    #section('PlateFiber', secTag, matTag, h)
    ops.section('PlateFiber',701,601,h)

    msize = np.min([msizeL,msizeB])
    #  ShellDKGT: eleArgs=[secTag]
    ops.mesh('quad',10,4,*[1,2,3,4],0,6,msize,'ShellNLDKGT',701)
    
    #stiff bar
    Astiff=0.1*0.1*m2
    Istiff=1/12*0.1*0.1**3*m4
    Estiff=E*100
    Gstiff=G*100
    Jstiff=Istiff+Istiff
    ops.geomTransf('Corotational', 10001, *[0,1,0])
    ops.section('Elastic', 10001, Estiff,Astiff,Istiff,Istiff,Gstiff,Jstiff)
    ops.beamIntegration('Lobatto', 10001, 10001, 2)
    ops.element('elasticBeamColumn', 10001, *[5,3], 10001, 10001)
    ops.geomTransf('Corotational', 10002, *[0,1,0])
    ops.section('Elastic', 10002, Estiff,Astiff,Istiff,Istiff,Gstiff,Jstiff)
    ops.beamIntegration('Lobatto', 10002, 10002, 2)
    ops.element('elasticBeamColumn', 10002, *[6,4], 10002, 10002)
    
    ops.geomTransf('Corotational',11001, *[1,0,0])
    ops.section('Elastic', 11001, Estiff,Astiff,Istiff,Istiff,Gstiff,Jstiff)
    ops.beamIntegration('Lobatto', 11001, 11001, 2)
    ops.element('elasticBeamColumn', 11001, *[3,16], 11001, 11001)
    ops.element('elasticBeamColumn', 11002, *[16,17], 11001, 11001)
    ops.element('elasticBeamColumn', 11003, *[17,18], 11001, 11001)
    ops.element('elasticBeamColumn', 11004, *[18,4], 11001, 11001)
    ops.element('elasticBeamColumn', 11005, *[1,30], 11001, 11001)
    ops.element('elasticBeamColumn', 11006, *[30,29], 11001, 11001)
    ops.element('elasticBeamColumn', 11007, *[29,28], 11001, 11001)
    ops.element('elasticBeamColumn', 11008, *[28,2], 11001, 11001)

    # create TimeSeries
    #timeSeries('Linear', tag, '-factor', factor=1.0, '-tStart', tStart=0.0)
    ops.timeSeries("Linear", 1)
    #pattern('Plain', patternTag, tsTag, '-fact', fact)
    ops.pattern("Plain", 1, 1)
    return

def make_load_ecc_N():
    ops.load(5, -p0N/2, 0.0, 0.0, 0.0, 0.0, 0.0)
    ops.load(6, -p0N/2, 0.0, 0.0, 0.0, 0.0, 0.0)

    #recorder('Node', '-file', filename, 
    #         '-xml', filename, '-binary', filename, '-tcp', inetAddress, port, '-precision', nSD=6, 
    #         '-timeSeries', tsTag, '-time', '-dT', deltaT=0.0, '-closeOnWrite', 
    #         '-node', *nodeTags=[], 
    #         '-nodeRange', startNode, endNode, '-region', regionTag, 
    #         '-dof', *dofs=[], respType)
    outfiledisp='./out_ecc/N_pb_dispX_'+str(ethick)+'_'+str(ratio)+'.txt'
    outfilereac='./out_ecc/N_pb_reacX_'+str(ethick)+'_'+str(ratio)+'.txt'
    ops.recorder('Node', '-file', outfiledisp, '-time', '-node', *[5,6], '-dof', 1, 'disp')
    ops.recorder('Node', '-file', outfilereac, '-time', '-node', *[1,2], '-dof', 1, 'reaction')

    return
    
def make_load_ecc_M():
    ops.load(5, p0M, 0.0, 0.0, 0.0, 0.0, 0.0)
    ops.load(6, -p0M, 0.0, 0.0, 0.0, 0.0, 0.0)

    #recorder('Node', '-file', filename, 
    #         '-xml', filename, '-binary', filename, '-tcp', inetAddress, port, '-precision', nSD=6, 
    #         '-timeSeries', tsTag, '-time', '-dT', deltaT=0.0, '-closeOnWrite', 
    #         '-node', *nodeTags=[], 
    #         '-nodeRange', startNode, endNode, '-region', regionTag, 
    #         '-dof', *dofs=[], respType)
    outfiledisp='./out_ecc/M_pb_dispX_'+str(ethick)+'_'+str(ratio)+'.txt'
    outfilereac='./out_ecc/M_pb_reacX_'+str(ethick)+'_'+str(ratio)+'.txt'
    ops.recorder('Node', '-file', outfiledisp, '-time', '-node', *[5,6], '-dof', 1, 'disp')
    ops.recorder('Node', '-file', outfilereac, '-time', '-node', *[1,2], '-dof', 1, 'reaction')

    return
    
def run_bckl_analysis_nonlin_N():
    # 解析の諸条件
#    ops.constraints('Plain')
    ops.constraints('Transformation')
#    ops.numberer('RCM')
    ops.numberer('Plain')
    ops.system('BandGeneral')
#    ops.test('NormDispIncr',1e-3,1000,2)
    ops.test('NormUnbalance',1e-3,10000,0)
    ops.algorithm('KrylovNewton')

    Nsteps = 1000
    Umax = L/100
    dU = Umax/Nsteps

    #integrator('DisplacementControl', nodeTag, dof, incr, numIter=1, dUmin=incr, dUmax=incr)
    ops.integrator('DisplacementControl',5 ,1,-dU)
    ops.analysis('Static')
    ops.analyze(Nsteps)
    
    print('Analysis_N_Finished')

    print('ethick,ratio:',ethick,ratio)
    
    print('Euler Buckling Load Factor (1st mode)')
    pcr=np.pi**2*(1.0)**2 * E * Iy / (L**2)
    facNcrEuler=pcr/p0N
    print(facNcrEuler)

def run_bckl_analysis_nonlin_M():
    # 解析の諸条件
#    ops.constraints('Plain')
    ops.constraints('Transformation')
#    ops.numberer('RCM')
    ops.numberer('Plain')
    ops.system('BandGeneral')
#    ops.test('NormDispIncr',1e-3,1000,2)
    ops.test('NormUnbalance',1e-3,10000,0)
    ops.algorithm('KrylovNewton')

    Nsteps = 1000
    Umax = L/100
    dU = Umax/Nsteps

    #integrator('DisplacementControl', nodeTag, dof, incr, numIter=1, dUmin=incr, dUmax=incr)
    ops.integrator('DisplacementControl',5 ,1,-dU)
    ops.analysis('Static')
    ops.analyze(Nsteps)
    
    print('Analysis_M_Finished')

    print('ethick,ratio:',ethick,ratio)
    
    print('Mcr (Cb=1.0) Factor')
    #https://an-sd.jp/%E5%B9%B3%E9%8B%BC%E3%81%AE%E8%A8%B1%E5%AE%B9%E6%9B%B2%E3%81%92%E3%83%A2%E3%83%BC%E3%83%A1%E3%83%B3%E3%83%88%E3%81%AE%E7%AE%97%E5%87%BA%E5%BC%8F/
    mcr=np.pi/L*((E*Iy*G*J)**(0.5))
    pcr=mcr/B
    facMcrBS=pcr/p0M
    print(facMcrBS)


# +===============================================================================+
# |                            Define some functions                              |
# +===============================================================================+
E=2.05E+005*N/mm2
nu=0.3
G=E/(2*(1+nu))
L=0.70*m #length
B=0.30*m #beam height
h=0.009*m #beam thick
msizeB=B/4
msizeL=L/10

p0N=0.0001*kN
p0M=0.0001*kN

Iy=B*(h**3.0)/12
J=1/3*1.0*(h**3)

# ethick, ratio roop
ethicks = [0.018*m,0.009*m,0.006*m,0.003*m,0.001*m,-0.001*m,-0.003*m,-0.006*m,-0.009*m,-0.018*m,]
#ethicks = [0.001*m]
ratios = [0.1,0.3,0.5,0.7,0.9]
#ratios = [0.5]

from itertools import product
for ethick, ratio in product(ethicks, ratios):
        
    make_model_ecc()
    make_load_ecc_N()    
    run_bckl_analysis_nonlin_N()
    make_model_ecc()
    make_load_ecc_M()    
    run_bckl_analysis_nonlin_M()
    
#### output data
WARNING: element ShellNLDKGT is not currently supported in mesh
WARNING: failed to set element arguments
Traceback (most recent call last):
  File "rhinocode:///grasshopper/1/3c96ec9a-596f-4489-86b2-cbac1320db3c/d8e35d13-6845-4e13-8c94-44e7c77ee7ed", line 227, in <module>
  File "rhinocode:///grasshopper/1/3c96ec9a-596f-4489-86b2-cbac1320db3c/d8e35d13-6845-4e13-8c94-44e7c77ee7ed", line 69, in make_model_ecc
OpenSeesError: See stderr output

今後のRhino 8の(マイナー?)バージョンアップを待ち、openseespyを合わせてバージョンアップする必要がある。

まとめ

・2024年7月現在のRhino 8 (8.9.24194.1812)のScript editorで使用可能なpythonのバージョンは3.9.10。よって、これに合うopenseespyのバージョン(例えばopenseespy-3.3.0.1.1)を指定してインストールする必要がある。ただし、3.3.0.1.1を指定しようとしてもなぜか上から3つまでの数値しか認識してくれない(一般的なバージョニングの慣例に基づく仕様?)のため、ここではopenseespy<=3.4.0としてDLした。
・試される場合は自己責任でお願いします。

追伸

こちらの方法の方が良い?いちいち読み込む必要なさそう。

コマンドプロンプト上でpipを利用してインストールしておくみたい。通常のpipを使ったインストールなのでオプションでバージョン指定もでき、こちらの方がよさげ。

C:\Users\owner\.rhinocode\py39-rh8\Scripts>pip3.9.exe install <package_name>

試していないのでわからない。公式の方法ではなさそうなので、下手したらまた再インストールが必要になるかも。

この記事が気に入ったらサポートをしてみませんか?