<p>很抱歉我误解了你的帖子。我真的想了想你昨晚睡觉前我以为你是什么意思。所以,我向你道歉</p>
<p>我想我应该问问你是否找到了解决办法</p>
<p>如果没有,您是否使用任何pip/venv包装器,如“pipenv”或“virtualenvwrapper”(这可能会被弃用)?我询问的唯一原因是我知道“pipenv”将允许您在项目的“Pipfile”中实际指定dev dep。那么,你不能将neovim和pyright作为开发副总裁添加到你正在进行的任何项目中吗</p>
<p>如果这不是一个选项,“venv”有一个命令行参数,允许它访问系统的python包</p>
<pre><code>usage: venv [-h] [ system-site-packages] [ symlinks | copies] [ clear]
[ upgrade] [ without-pip] [ prompt PROMPT] [ upgrade-deps]
ENV_DIR [ENV_DIR ...]
Creates virtual Python environments in one or more target directories.
positional arguments:
ENV_DIR A directory to create the environment in.
optional arguments:
-h, help show this help message and exit
system-site-packages
Give the virtual environment access to the system
site-packages dir.
symlinks Try to use symlinks rather than copies, when symlinks
are not the default for the platform.
copies Try to use copies rather than symlinks, even when
symlinks are the default for the platform.
clear Delete the contents of the environment directory if it
already exists, before environment creation.
upgrade Upgrade the environment directory to use this version
of Python, assuming Python has been upgraded in-place.
without-pip Skips installing or upgrading pip in the virtual
environment (pip is bootstrapped by default)
prompt PROMPT Provides an alternative prompt prefix for this
environment.
upgrade-deps Upgrade core dependencies: pip setuptools to the
latest version in PyPI
Once an environment has been created, you may wish to activate it, e.g. by
sourcing an activate script in its bin directory.
</code></pre>
<p><code> system-site-packages</code>可能会有所帮助</p>
<p>也许可以全局安装neovim和pyright,然后在创建项目venv时指定此标志。然后将<code>g:python3_host_prog</code>指向您为项目新建的venv。然后,venv应该可以访问它需要的所有包,项目中的包以及您的全局“neovim”和“pyright”</p>
<p>再一次,我为误会感到抱歉。那一定给人的印象是超级屈尊</p>
<p>如果你找到了适合自己情况的解决方案,请告诉我你做了什么。如果没有,让我知道我的建议是否有效</p>
<p>谢谢,祝你今天愉快</p>