简体   繁体   English

默认情况下,Pypi软件包安装在哪里?

[英]Where are Pypi packages installed by default?

I am new to programming and Python and what's really bothering me is that on my Mac, I'm used to knowing exactly where everything is and what's in every folder, but doing things through the command line is very different, so I don't know where things like Python Packages are being installed to by default. 我是编程和Python的新手,真正让我感到困扰的是,在Mac上,我习惯确切地知道每个文件夹的位置和内容,但是通过命令行执行操作却大不相同,所以我没有知道默认情况下将Python Packages之类的东西安装在哪里。

According to the Pypi site, the packages are installed here: /usr/local/lib/python2.3/site-packages' 根据Pypi站点,这些软件包安装在这里:/usr/local/lib/python2.3/site-packages'

However when I cd to /usr/local/lib/, all I see in this folder are 'wx-python unicode', which I'm guessing was an accident on my part because I forgot to activate my virtual environment when I installed it? 但是,当我CD到/ usr / local / lib /时,在此文件夹中看到的只是“ wx-python unicode”,我猜这是偶然的,因为我在安装虚拟环境时忘了激活虚拟环境?

Why is nothing in my /lib/ folder? 为什么我的/ lib /文件夹中没有任何内容?

If you ever want to know where a module source file is located: 如果您想知道模块源文件的位置:

import some_module

print some_module.__file__

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM