티스토리 뷰

https://youtu.be/_U5gcTEsupE

 


 


excute 코드

import sys
import os
import platform

def onStart():
	user = 'ㅇㅇㅇ' # Update accordingly
 
	condaEnv = 'ㅇㅇ' # Update accordingly
 
	if platform.system() == 'Windows':
		if sys.version_info.major >= 3 and sys.version_info.minor >= 8:
			"""
			Double check all the following paths, it could be that your anaconda 'envs' folder is not in your User folder depending on your conda install settings and conda version.
			"""
			os.add_dll_directory('C:/Users/'+user+'/.conda/envs/'+condaEnv+'/DLLs')
			os.add_dll_directory('C:/Users/'+user+'/.conda/envs/'+condaEnv+'/Library/bin')
		else:
			"""
			Double check all the following paths, it could be that your anaconda 'envs' folder is not in your User folder depending on your conda install settings and conda version.
			"""
			# Not the most elegant solution, but we need to control load order
			os.environ['PATH'] = 'C:/Users/'+user+'/.conda/envs/'+condaEnv+'/DLLs' + os.pathsep + os.environ['PATH']
			os.environ['PATH'] = 'C:/Users/'+user+'/.conda/envs/'+condaEnv+'/Library/bin' + os.pathsep + os.environ['PATH']
 
		sys.path = ['C:/Users/'+user+'/.conda/envs/'+condaEnv+'/Lib/site-packages'] + sys.path
 
	else:
		"""
		MacOS users should include path to .dlybs / MacOS binaries, site-packages
		"""
		os.environ['PATH'] = '/Users/'+user+'/opt/.conda/envs/'+condaEnv+'/lib' + os.pathsep + os.environ['PATH']
		os.environ['PATH'] = '/Users/'+user+'/opt/.conda/envs/'+condaEnv+'/bin' + os.pathsep + os.environ['PATH']
		# The following path might need editing (python3.9) based on the python version used with conda
		sys.path = ['/Users/'+user+'/opt/miniconda3/envs/'+condaEnv+'/lib/python3.9/site-packages'] + sys.path
 
	return
	
	return

간편한 COMP 파이썬 env 연결해주는 Base 생성

1.base 생성

그안에 excute 넣어주기

밖 base에서

커스텀 페이지 하나만들고

그안에 파라미터

str : username

str : envname

pulse : reset

이러고 base 안에 들어가서 : parameter node 

 

excute : start pulse에 연결

def onStart():

user = op('parameter1')[1,1]
 
condaEnv = op('parameter1')[2,1]


 로 수정


td_pip

https://derivative.ca/community-post/asset/td-pip/63077

 

TD PIP

Working with external libraries can be super cumbersome. You first have to install python with pip, download the library import it into your project and append the project folder. All very unconvinient. And what happens when you move the project? Are all t

derivative.ca

https://olib.amb-service.net/component/td-pip

 

TD PIP by AlphaMoonbase

Get dynamic python modules.<br> View TD PIP and many other TouchDesigner components in the Olib!

olib.amb-service.net

다운로드 파일.

td_pip

drag&drop

코드 : read me

Get dynamic python modules.

Having to handle external python libraries is a thing of the past. This component installs PIP directly in your project and dynamicly downloads and import the libraries in your project.

To install and use a package, instead of running
import my_module
run TD_Pip like this:
my_module = op('td_pip').ImportModule( "my_module", 
    pipPackageName = "my_module_on_pip, 
    additionalSettings = [list of additional arguments] )

i.E. 

import socketio
becomes
socketio = op("td_pip").ImportModule( "socketio", pipPackageName = "python-socketio[client]" )


To just install a package run
 
op('td_pip').InstallPackage( package_name )
 
To check if a package is installed run
op("td_pip").TestModule("TestModule")

To force an upgrade on a Package run
op("td_pip").UpgradePackage( "TestModule" )

 

설치 자동으로 됨.와우

이런식으로 바로바로 설치가능함.

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함