linux下导入自己写的模块,找不到conda命令

自定义的模块必须PYTHONPATH上,否则在导入该模块时会出现找不到该模块的错误,即必须把所需要的模块的路径添加到PYTHONPATH(一般情况下是把lib/python3.5/site-packages添加到PYTHONPATH)。具体做法如下:

(1) 在~/.bashrc 中输出环境变量

export PYTHONPATH=$PYTHONPATH:模块路径

(2) 更新PATHONPATH,使配置生效

  source ~/.bashrc

查看GPU运行状况

$ watch -n 0 nvidia-smi

安装anaconda后找不到conda命令:
在~/.bashrc最后添加export PATH=$PATH:/home/wangfang/anaconda3/bin
其中/home/wangfang/anaconda3/bin为你安装的anaconda的bin目录位置

vim ~/.bashrc

在最后一行添加

export PATH=$PATH:/home/wangfang/anaconda3/bin

保存后执行:

source ~/.bashrc

使配置生效

发布了59 篇原创文章 · 获赞 38 · 访问量 7万+
展开阅读全文

anconda更新后出现OSError[Winerror 126]找不到指定模块该如何解决?

07-11

如题,以下为报错 Traceback (most recent call last): File "F:\a\lib\site-packages\conda\exceptions.py", line 1043, in __call__ return func(*args, **kwargs) File "F:\a\lib\site-packages\conda\cli\main.py", line 84, in _main exit_code = do_call(args, p) File "F:\a\lib\site-packages\conda\cli\conda_argparse.py", line 80, in do_call module = import_module(relative_mod, __name__.rsplit('.', 1)[0]) File "F:\a\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "F:\a\lib\site-packages\conda\cli\main_install.py", line 8, in <module> from .install import install File "F:\a\lib\site-packages\conda\cli\install.py", line 19, in <module> from ..core.index import calculate_channel_urls, get_index File "F:\a\lib\site-packages\conda\core\index.py", line 9, in <module> from .package_cache_data import PackageCacheData File "F:\a\lib\site-packages\conda\core\package_cache_data.py", line 15, in <module> from conda_package_handling.api import InvalidArchiveError File "F:\a\lib\site-packages\conda_package_handling\api.py", line 3, in <module> from libarchive.exception import ArchiveError as _LibarchiveArchiveError File "F:\a\lib\site-packages\libarchive\__init__.py", line 1, in <module> from .entry import ArchiveEntry File "F:\a\lib\site-packages\libarchive\entry.py", line 6, in <module> from . import ffi File "F:\a\lib\site-packages\libarchive\ffi.py", line 27, in <module> libarchive = ctypes.cdll.LoadLibrary(libarchive_path) File "F:\a\lib\ctypes\__init__.py", line 434, in LoadLibrary return self._dlltype(name) File "F:\a\lib\ctypes\__init__.py", line 356, in __init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] 找不到指定的模块。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "F:\a\Scripts\conda-script.py", line 12, in <module> sys.exit(main()) File "F:\a\lib\site-packages\conda\cli\main.py", line 150, in main return conda_exception_handler(_main, *args, **kwargs) File "F:\a\lib\site-packages\conda\exceptions.py", line 1335, in conda_exception_handler return_value = exception_handler(func, *args, **kwargs) File "F:\a\lib\site-packages\conda\exceptions.py", line 1046, in __call__ return self.handle_exception(exc_val, exc_tb) File "F:\a\lib\site-packages\conda\exceptions.py", line 1090, in handle_exception return self.handle_unexpected_exception(exc_val, exc_tb) File "F:\a\lib\site-packages\conda\exceptions.py", line 1101, in handle_unexpected_exception self.print_unexpected_error_report(error_report) File "F:\a\lib\site-packages\conda\exceptions.py", line 1171, in print_unexpected_error_report from .cli.main_info import get_env_vars_str, get_main_info_str File "F:\a\lib\site-packages\conda\cli\main_info.py", line 19, in <module> from ..core.index import _supplement_index_with_system File "F:\a\lib\site-packages\conda\core\index.py", line 9, in <module> from .package_cache_data import PackageCacheData File "F:\a\lib\site-packages\conda\core\package_cache_data.py", line 15, in <module> from conda_package_handling.api import InvalidArchiveError File "F:\a\lib\site-packages\conda_package_handling\api.py", line 7, in <module> from .tarball import CondaTarBZ2 as _CondaTarBZ2 File "F:\a\lib\site-packages\conda_package_handling\tarball.py", line 7, in <module> import libarchive File "F:\a\lib\site-packages\libarchive\__init__.py", line 1, in <module> from .entry import ArchiveEntry File "F:\a\lib\site-packages\libarchive\entry.py", line 6, in <module> from . import ffi File "F:\a\lib\site-packages\libarchive\ffi.py", line 27, in <module> libarchive = ctypes.cdll.LoadLibrary(libarchive_path) File "F:\a\lib\ctypes\__init__.py", line 434, in LoadLibrary return self._dlltype(name) File "F:\a\lib\ctypes\__init__.py", line 356, in __init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] 找不到指定的模块。 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览