vps配置jupyterlab远程访问服务

vps配置jupyterlab远程访问服务 撸了个小鸡鸡,打算用来做jupyter server,在此记录下此次配置全过程。 安装JupyterLab # 更新系统 apt update&&apt upgrade -y # 安装python apt install python3 #安装JpyterLab和中文语言 pip3 install jupyterlab jupyterlab-language-pack-zh-CN 配置jupyterlab 生成配置文件,存放路径为.jupyter/jupyter_lab_config.py root@hcss-ecs-279f:~# jupyter lab --generate-config Writing default config to: /root/.jupyter/jupyter_lab_config.py 编辑配置文件vi .jupyter/jupyter_lab_config.py,参考以下配置 # 允许任意IP访问 c.ServerApp.allow_origin = '*' c.ServerApp.ip = '0.0.0.0' # 自定义端口号 c.ServerApp.port = 8888 # 允许root运行 c.ServerApp.allow_root = True 下来设置访问密码 root@hcss-ecs-279f:~# jupyter lab password Enter password: Verify password: [JupyterPasswordApp] Wrote hashed password to /root/.jupyter/jupyter_server_config.json 然后就可以使用jupyter lab来运行服务。 root@hcss-ecs-279f:~# jupyter lab ... ... [I 2025-04-10 10:41:35.533 ServerApp] jupyterlab | extension was successfully loaded. [I 2025-04-10 10:41:35.536 ServerApp] notebook | extension was successfully loaded. [I 2025-04-10 10:41:35.537 ServerApp] Serving notebooks from local directory: /root [I 2025-04-10 10:41:35.537 ServerApp] Jupyter Server 2.15.0 is running at: [I 2025-04-10 10:41:35.537 ServerApp] http://hcss-ecs-279f:9876/lab [I 2025-04-10 10:41:35.537 ServerApp] http://127.0.0.1:9876/lab ... ... 按提示通过IP:9876方式来远程访问JupyterLab服务即可。 ...

四月 10, 2025 · JQX

pip设置代理的几种方法

pip设置代理的几种方法 通常情况下,国内使用PIP可以参考Pypi国内镜像设置来设置国内镜像以加快安装速度。 但有的pip软件包国内镜像出于各种考虑并未收录,因此就得使用Pipy.org的官方源安装,在网络状况不理想的情况下,我们可以使用设置代理来加速安装过程。 例如,我们已经获得了代理服务的配置,如下: http://127.0.0.1:2080 socks://127.0.0.1:2080 如果是linux系统,可以使用系统自有的环境变量http_proxy、https_proxy $ export HTTP_PROXY=http://127.0.0.1:2080 $ export HTTPS_PROXY=http://127.0.0.1:2080 使用pip自带选项--proxy来使用代理 $ pip install --proxy=http://127.0.0.1:2080 jupyter 使用pip配置文件pip.conf或pip.ini来设置代理 Windows下是pip.ini,linux下是~/.pip/pip.conf或/etc/pip.conf [global] proxy = http://127.0.0.1:2080

十二月 12, 2024 · JQX

Pypi国内镜像设置

Pypi国内镜像设置 PyPI(Python包索引)是最流行的Python软件存储库,使用Pypi可查找与安装由Python社区开发和共享的软件。 由于线路问题,国内通过pypi默认镜像安装或更新软件时可能会很慢,此种情况可以通过配置国内镜像来改善。 pypi临时使用国内镜像 临时使用国内镜像来安装jupyter pip install -i https://mirror.nju.edu.cn/pypi/web/simple jupyter 临时使用国内镜像来升级pip python -m pip install -i https://mirror.nju.edu.cn/pypi/web/simple --upgrade pip 设置pypi默认镜像 通过以下方法可以设置默认镜像 pip config set global.index-url https://mirror.nju.edu.cn/pypi/web/simple 国内pypi镜像列表 https://mirror.nju.edu.cn/pypi/web/simple 南京大学 https://mirrors.bfsu.edu.cn/pypi/web/simple 北京外国语大学 https://mirrors.neusoft.edu.cn/pypi/web/simple/ 大连东软信息学院 https://mirrors.jlu.edu.cn/pypi/simple/ 吉林大学 https://mirrors.njtech.edu.cn/pypi/web/simple/ 南京工业大学 https://mirror.nyist.edu.cn/pypi/web/simple/ 南阳理工学院 https://mirrors.pku.edu.cn/pypi/web/simple/ 北京大学 https://mirrors.sustech.edu.cn/pypi/web/simple 南方科技大学 https://pypi.tuna.tsinghua.edu.cn/simple 清华大学

七月 30, 2024 · JQX