V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
shiyuu
V2EX  ›  Jupyter

jupyter-notebook 内置环境变量问题

  •  
  •   shiyuu · 2022-11-21 11:06:38 +08:00 · 658 次点击
    这是一个创建于 524 天前的主题,其中的信息可能已经有所发展或是发生改变。
    使用的模块比较特殊
    import pyfstat

    在运行的时候会因为变量问题无法 import


    按照官方的办法把当前的环境添加到变量才能正常 import
    现在有什么办法,不用每一个项目都要用这样的办法添加变量?
    linux 系统下的变量全都添加过了,但是在 jupyter-notebook 新建或者激活新项目都不会加载这个目录作为变量

    import os
    import sys
    env_bin = os.path.dirname(sys.executable)
    if not env_bin in os.environ["PATH"]:
    os.environ["PATH"] = f'{env_bin}:{os.environ["PATH"]}'

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   966 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 20:16 · PVG 04:16 · LAX 13:16 · JFK 16:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.