본문 바로가기

언어30

[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.
pycuda install problem ProblemI tried to install PyCUDA using pip:1$ sudo pip install pycudaThe installation tries to compile a few C++ files and it failed on the very first file with this error:123456In file included from src/cpp/cuda.cpp:1:0:src/cpp/cuda.hpp:14:18: fatal error: cuda.h: No such file or directory#include ^compilation terminated.error: command 'x86_64-linux-gnu-gcc' failed with exit status 1Investigati.. 2016. 1. 11.