본문 바로가기

전체 글59

[python] 'from X import name' vs 'import X.name' Q. I'm wondering if there's any difference between the code fragmentfrom urllib import request and the fragmentimport urllib.request or if they are interchangeable. If they are interchangeable, which is the "standard"/"preferred" syntax (if there is one)? Thanks! A. It depends on how you want to access the import when you refer to it.from urllib import request # access request directly. mine = r.. 2016. 1. 17.
[python] understanding for 'from, import' 1. import X module X를 import하는 것을 의미한다. module X에 def된 함수들은 X.def_name으로 사용할 수 있다. 2. from X import a,b,c module X에서 정의된 a,b,c를 가져와서 쓸 수 있다. X.a, X.b, X.c가 아니라 a,b,c라는 이름을 그대로 쓰면된다. ------------------------------------------------------------------------------------------------------------------------------------------------------------- Anyway, here’s how these statements and functions work: im.. 2016. 1. 17.
[pycuda error] Failed to compile cuda_ndarray.cu: libcublas.so.6.5: cannot open shared object file: No such file or directory If you get an error message that is Failed to compile cuda_ndarray.cu: libcublas.so.6.5: cannot open shared object file: No such file or directory , follow this order.So you need to locate and configure that path:locate libcublas.so.6.5Add the following library path to ~/.bashrc (Second path has libcublas.so.6.5)sudo ldconfig /usr/local/cuda-6.5/lib64/ sudo ldconfig /usr/local/cuda-6.5/targets/x.. 2016. 1. 11.
program install in user path without sudo command if you install program in user path(not admin), $ cd 'program install files path' $ python setup develop --prefix=~/.local and if you want to install at other path, adjust './local'. --prefix=~/'path' that's path is in user $HOME. if --prefix=~/.local, .local folder is at $HOME/.local/. or You may need to add sudo before the pip command to install into your system’s site-packages directory. If y.. 2016. 1. 11.