python - Mounting a virtual environment via SSHFS on local machine using it's Python3 file not working
问题描述
So I have mounted a part of a development server which hold a virtual environment that is used for development testing. The reason for this is to get access to the installed packages such as Django-rest-framework and Django itself and not having it set up locally (to be sure to use the same version as the development server has). I know that it's perhaps better to use Docker for this, but that's not the case right now.
The way I've done it is installing SSHFS via an external brew (as it's no longer supported in the brew core) - via this link https://github.com/gromgit/homebrew-fuse
After that I've run this command in the terminal to via SSH mount the specific part of the development server that holds the virtual enviornment:
sshfs -o ssh_command='ssh -i /Users/myusername/.ssh/id_rsa' myusername@servername:/home/myusername/projectname/env/bin ~/mnt/projectname
It works fine and I have it mounted on my local disk in mnt/projectname.
Now I go into VSCode and go into the folder and select the file called "python3" as my interpreter (which I should, right?). However, this file is just an alias, being 16 bytes in size. I suspect something is wrong here, but I'm not sure on how to fix it. Can someone maybe take a look and give some input? I'll attach a screenshot of the mounted directory.
解决方案
The solution to the problem was using the VSCode extension Remote - SSH and run VSCode directly in the remote location, and from there being able to access the virtual environment.
推荐阅读
- python - 在三个骰子的列表中滚动两个骰子时找到最大值
- javascript - 无法在模式中输入文本框并使用新状态重新渲染
- python - 使用 seaborn 创建分组条形图
- python - 如何读取 csv,在 python 中获取最大列?
- r - 用多个变量的值编码一个变量
- c - 使用 sscanf 解析 C 中的字符串
- css - Bootstrap Nav Subnav 在悬停鼠标移动时消失
- c# - 从 DataTable 绑定的 DataGridView 中删除选定的行
- simulation - Comsol 多物理场研究论文
- javascript - 未捕获的类型错误:无法读取 HTMLParagraphElement 处未定义的属性“id”。