Colab 无法(如何)从 git 导入文件

Colab Failed (How) to import files from git

我刚开始使用 Colab,找不到任何让它工作的东西。有人可以帮我修复它或分享解决方案吗?

!git clone https://github.com/droyed/eucl_dist.git
!pip install pycuda
!pip install scikit-cuda

from eucl_dist.gpu_dist import dist as gdist
>ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-3a47b1a9783d> in <module>()  
----> 1 from eucl_dist.gpu_dist import dist as gdist  

ModuleNotFoundError: No module named 'eucl_dist.gpu_dist'

from eucl_dist.eucl_dist.gpu_dist import dist as gdist
>ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-3-b8b89f98116e> in <module>()  
    ----> 1 from eucl_dist.eucl_dist.gpu_dist import dist as gdist
    /content/eucl_dist/eucl_dist/gpu_dist.py in <module>()  
          3 import skcuda.linalg as culinalg  
          4 import skcuda.misc as misc  
    ----> 5 from eucl_dist.gpu_supp import sq_sums, squared_sum, convert_f32  
          6   
          7 culinalg.init()

ModuleNotFoundError: No module named 'eucl_dist.gpu_supp'

非常感谢!

'eucl_dist' 下又出现了名为 'eucl_dist' 的子文件夹。

因此,您必须访问“./eucl_dist/eucl_dist/gpu_dist”

试试这个。

%cd eucl_dist
from eucl_dist.gpu_dist import dist as gdist
%cd ..