YES丶man 2022-04-14 15:09 采纳率: 100%
浏览 35
已结题

虚拟打包时用什么命令可以去除系统自带的包啊?具体在哪里加指令还望详细指导,我脑壳疼

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图

```python

C:\Users\沈仲藩>virtualenv venv1-no-site-packages
created virtual environment CPython3.7.3.final.0-64 in 640ms
  creator CPython3Windows(dest=C:\Users\沈仲藩\venv1-no-site-packages, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\沈仲藩\AppData\Local\pypa\virtualenv)
    added seed packages: pip==22.0.4, setuptools==62.1.0, wheel==0.37.1
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

C:\Users\沈仲藩\venv1>mkvirtualenv --python=python3 venv1
created virtual environment CPython3.7.3.final.0-64 in 614ms
  creator CPython3Windows(dest=C:\Users\沈仲藩\Envs\venv1, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\沈仲藩\AppData\Local\pypa\virtualenv)
    added seed packages: pip==22.0.4, setuptools==62.1.0, wheel==0.37.1
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

(venv1) C:\Users\沈仲藩\venv1>pip list
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
WARNING: Ignoring invalid distribution -rllib3 (c:\programdata\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -penpyxl (c:\programdata\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -arkupsafe (c:\programdata\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -andas (c:\programdata\anaconda3\lib\site-packages)
Package                            Version
---------------------------------- ---------
aiohttp                            3.7.4
alabaster                          0.7.12
altgraph                           0.17.2
anaconda-client                    1.7.2
anaconda-navigator                 1.9.7
anaconda-project                   0.8.2
appdirs                            1.4.4
asn1crypto                         0.24.0
astroid                            2.2.5
astropy                            3.1.2
async-generator                    1.10
async-timeout                      3.0.1
atomicwrites                       1.3.0
attrs                              20.3.0
Automat                            20.2.0
Babel                              2.6.0
backcall                           0.1.0
backports.os                       0.1.1
backports.shutil-get-terminal-size 1.0.0
bcrypt                             3.2.0
beautifulsoup4                     4.7.1
bitarray                           0.8.3
bkcharts                           0.2
blaze                              0.11.3
bleach                             3.1.0
bokeh                              1.0.4
boto                               2.49.0
Bottleneck                         1.2.1
bs4                                0.0.1
certifi                            2021.10.8
cffi                               1.15.0
chardet                            3.0.4
Click                              7.0
cloudpickle                        0.8.0
clyent                             1.2.2
colorama                           0.4.1
comtypes                           1.1.7
conda                              4.12.0
conda-build                        3.17.8
conda-package-handling             1.3.11
conda-verify                       3.1.1
configparser                       5.2.0
constantly                         15.1.0
contextlib2                        0.5.5
crayons                            0.4.0
cryptography                       2.6.1
cssselect                          1.1.0
cycler                             0.10.0
Cython                             0.29.23
cytoolz                            0.9.0.1
dask                               1.1.4
datashape                          0.5.4
decorator                          4.4.0
defusedxml                         0.5.0
distlib                            0.3.4
distributed                        1.26.0
docutils                           0.14
entrypoints                        0.3
environs                           9.3.0
et-xmlfile                         1.0.1
fabric                             2.6.0
fake-headers                       1.0.2
fake-useragent                     0.1.11
fastcache                          1.0.2
filelock                           3.6.0
Flask                              1.1.2
Flask-Cors                         3.0.10
fsspec                             2022.1.0
future                             0.17.1
gensim                             4.1.2

反正后面还有很多,我要吐了

运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
  • 写回答

1条回答 默认 最新

  • 不会长胖的斜杠 后端领域新星创作者 2022-04-14 15:19
    关注

    加个参数 --no-site-packages

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 4月22日
  • 已采纳回答 4月14日
  • 创建了问题 4月14日

悬赏问题

  • ¥15 (标签-STM32|关键词-智能小车)
  • ¥20 关于#stm32#的问题,请各位专家解答!
  • ¥15 (标签-python)
  • ¥15 第一个已完成,求第二个做法
  • ¥20 搭建awx,试了很多版本都有错
  • ¥15 java corba的客户端该如何指定使用本地某个固定IP去连接服务端?
  • ¥15 activiti工作流问题,求解答
  • ¥15 有人写过RPA后台管理系统么?
  • ¥15 Bioage计算生物学年龄
  • ¥20 如何将FPGA Alveo U50恢复原来出厂设置哇?