简体   繁体   English

Python软件包安装在哪里

[英]Where are the Python packages installed

I'm learning Python 3.5 using Visual Studio as my IDE. 我正在学习使用Visual Studio作为IDE的Python 3.5。 I installed the Python Tools for VS and looking at the code. 我安装了VS的Python工具并查看代码。 I see there are a lot of from statements that reference Python packages: 我看到有很多引用Python包的from语句:

from __future__ import unicode_literals

from django import forms
from django.contrib.auth import (
    authenticate, get_user_model, password_validation,
)
from django.contrib.auth.hashers import (
    UNUSABLE_PASSWORD_PREFIX, identify_hasher,
)
from django.contrib.auth.models import User
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import EmailMultiAlternatives

Where are these pacakges stored on my Windows machine? 这些文件存储在Windows计算机上的什么位置? I tried looking in the Python installation folders/subfolders but nothing. 我尝试查找Python安装文件夹/子文件夹,但一无所获。 What are the file names including the extension? 包括扩展名的文件名是什么?

__future__ isn't a package - it's a special future statement which declares the use of a planned Python feature. __future__不是包-这是一条特殊的future语句 ,它声明使用计划的Python功能。

For your other packages, you'll usually find them in your Python install location (for me, this was C:\\Python34 ) > Lib > site-packages . 对于其他软件包,通常会在Python安装位置找到它们(对我来说,这是C:\\Python34 )> Lib > site-packages Here there are directories for most packages, and then .py files for some others. 这里有大多数软件包的目录,然后是其他一些的.py文件。

If you can't find packages there, have a look at the value of the PYTHONPATH environment variable on your system. 如果在那里找不到软件包,请查看系统上PYTHONPATH环境变量的值。 This will point to extra packages not found in Lib/site-packages . 这将指向Lib/site-packages找不到的额外Lib/site-packages

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

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