python dist-packages 和 site-packages

双目视觉入门实战:用Matlab标定相机,再到Python OpenCV完成测距的完整链路 本文详细介绍了双目视觉技术的完整实现流程,从Matlab相机标定到Python OpenCV测距的全链路实践。重点解析了Matlab与OpenCV的参数转换技巧,以及立体校正、视差计算等关键步骤的代码实现,帮助开发者快速掌握双目测距系统的搭建方法。 阅读详情

dist-packages 和site-packages在我的ubuntu12上都在/usr/local/lib/python2.7目录下

今天安装django时发现一个奇怪的现象:

我使用 pip install Django==1.8.4安装的django,安装成功,直接在终端使用django-admin也成功,但是进入python:import dnango,却提示no module named django,真的百思不得其解。

查了一番资料后得知原因:

当python import模块的时候,就通过sys.path里面的目录列表下面去查找


我的django安装在dist-packages下面的,但是sys.path里面没有这个目录,当我使用os.sys.path.append将这个目录加入时,能够import了,但是这个随着python的重启就会消失。

然后我发现之前安装的pymysql没啥问题(忘了怎么装的了),然后我发现这个paramiko是安装在site-packages下面的,而sys.path列表里是有site-packages这个目录的

我的解决办法是将site-packages里建一个dist-packages/django的软连接,ok。当然更好的办法应该是将dist-packages加入sys.path


但是问题是这个dist-packages 和site-packages之间有啥不可见人的故事呢?搞得如此麻烦


dist-packages是debian系统及其衍生系统的默认python的模块默认安装目录,如果使用包管理器(如apt-get)安装python的模块,都会安装到/usr/lib/python2.7/dist-packages

而easy_install 和pip都是通过包管理器来安装python模块的,但是他们把安装包安装在/usr/local/lib/python2.7/dist-packages。而通过源(编译安装没试过,不知道)自己手动安装的python是使用site-packages来查找模块,这样做让系统的python模块和用户自己安装的模块分割开来,互不影响


btw: 在我的机子上,系统自带的python安装在/usr/lib/python2.7下面的,而我自己安装的python在/usr/local/lib/python2.7下面,在终端中直接输入python进入的是我自己装的python。



YOLOv11 改进 - 即插即用 | PST金字塔稀疏Transformer:粗粒度到细粒度推理优化特征提取,提升复杂场景适应性 本文介绍了金字塔稀疏 Transformer(PST)与 YOLOv11 的结合。主流基于注意力的特征融合方法计算复杂度高、实现难度大,作者提出 PST 模块,融合粗到细令牌选择与共享注意力参数机制,在保留空间细节的同时降低计算量。该模块通过层级化注意力机制、动态令牌选择与参数共享,实现高效多尺度特征融合 阅读详情

相关推荐

FoundationPose复现及Realsense应用

FoundationPose是一个统一的基础模型,用于6D对象姿态估计和跟踪,支持基于模型和无模型的设置。在测试时可以立即应用于未见过的新对象,无需微调,只要给出其CAD模型,或者捕获少量RGBD参考图像。得益于统一框架,下游姿态估计模块在两种3D模型设置中都是相同的,当没有CAD模型时,使用神经隐式表示进行高效的新视角合成。通过大规模合成训练,辅以大型语言模型(LLM)、一种基于transformer的新架构和对比学习公式,实现了强大的泛化能力。

m0_56661101的博客 1万+

python pip安装的包放在哪里(site-packages目录的位置)

python pip安装的包放在哪里 使用 pip list 查看已安装的包名 然后用 pip show 包名,就可以看到安装到哪了 通常安装在python安装目录下的lib/site-packages目录下!

西京刀客 8万+

如何构建智能聊天系统

聊天分为听、思考、读,简单的通过ASR、LLM、TTS三类模型的组合可以实现,最近openai推出支持多模态的GPT-4o模型,可以把三个模型真正融合成在一起。现在市面上的模型百花齐放,各有所长。要实现可落地的方案,需要结合业务,验证模型效果,同时也要考虑方案的可行性,有些模型在国内能用,有些在国内不能用。

xsgnzb的专栏 2107

python安装第三方包的安装路径,dist-packages和site-packages区别

简单来说 如果是系统自带的python,会使用dist-packages目录; 如果你手动安装python,它会直接使用目录site-packages。 这允许你让两个安装隔离开来。 dist-packages:系统自带的python site-packages:自己安装的python python的包的安装路径如下 1、系统自带python 系统自带软件管理器安装

Learning by doing 3万+

PX4/ArduPilot源码克隆提速秘籍:国内镜像与子模块优化全攻略

本文详细介绍了PX4/ArduPilot源码克隆的提速秘籍,包括使用国内镜像源和子模块优化技巧。通过阿木实验室、华为云等国内镜像,克隆速度可提升20倍,同时提供子模块替换和并行编译等实用方法,大幅提升开发效率。

weixin_29251567的博客 523

PCIE Lane Margining Linux 环境配置

Copy all the provided files in folder PYC38 or PYC310 to the created pcie_lmt folder. Index of /ftp/python/3.8.10/Copy below commands to a file and rename it as "scan_pcie.py", the commands are from "685662 PCIe-LMT-Gen4_Gen5-r0p77.pdf" in the lane margi

mysongshine的博客 1435

【Python】 探索Python的site-packages目录:初学者指南

无论是为了安装新的库,还是为了解决依赖问题,了解这个目录的位置都是非常有用的。通过上述的几种方法,你可以轻松地找到这个目录,无论你使用的是哪种操作系统或Python版本。记住,良好的环境管理是高效Python开发的关键。这个目录的确切位置可能会因操作系统和Python版本的不同而有所变化。了解如何找到这个目录对于管理你的Python环境和解决依赖问题非常重要。> 【痕迹】QQ+微信朋友圈和聊天记录分析工具1.0.4 (1)纯Python语言实现,使用Flask后端,本地分析,不上传个人数据。

PythonWeb实践 7178

Cadence SPB16. 6 安装流程

1.首先下载CadenceAllegroSPBorCAD16.6安装包 下载之后运行其中的setup.exe,然后先安装第一项LicenseManager 一直按next或install, 直到被询问license时,单击cancel,然后选是和finish。 2,安装Product Installtion 直接点next跳过这一步 安装完成后,点Exit退出 3.按ctrl+alt+delete打开任务管...

wangjie36的博客 5147

PyCharm安装requests模块

PyCharm 安装requests模块 使用pip install 安装第三方模块 $ pip install requests 如果pip install有问题的话,使用本地源码安装 本地源码安装 1、先克隆requests的源码到本地,比较省时间 $ git clone git://github.com/kennethreitz/requests.git 2、切换到requests源码目录里,使用python内置的setup.py install 本地安装 $ cd requests

qq_43649264的博客 2781

Python爬虫分析二手交易平台商品定价合理性:基于多维度数据挖掘与机器学习

本文针对二手交易平台商品定价合理性问题,设计并实现了一个基于Python的多技术融合爬虫系统,结合Scrapy框架、Selenium自动化测试工具、Anti-Scraping对抗技术以及机器学习算法,对国内主流二手交易平台(闲鱼、转转等)进行大规模数据采集与分析。系统实现了商品信息的多维度采集、价格合理性模型构建、可视化展示等功能,为二手商品买卖双方提供科学的定价参考。实验结果表明,该系统能够有效识别定价异常商品,准确率达到89.7%,具有较高的实用价值。关键词:Python爬虫;二手交易;定价分析;

2201_76125261的博客 297

MATLAB - 使用 RRT 进行挖掘机运动规划

本例演示了如何使用运动规划器在包含障碍物的环境中为挖掘机规划路径。在此示例中,您将以运动树的简化形式为挖掘机建模,然后使用基于采样的运动规划器确定挖掘机在存在障碍物的两个姿势之间的可行路径。在 Simscape™ 多体™ 模型中模拟结果。

机器人控制与仿真应用 1850

python 安装包 site-packages

当我们通过 pip 或其他方式安装一个 Python 包时,这些包的文件就会被复制到 site-packages 文件夹下。site-packages 文件夹通常位于 Python 的安装目录下的 Lib 文件夹内。具体的路径会根据你使用的操作系统和 Python 版本的不同而有所不同。

cliffordl的专栏 5128

揭秘AI人工智能中Stable Diffusion的模型微调技巧

Stable Diffusion作为一种强大的文本到图像生成模型,在艺术创作、设计、娱乐等多个领域展现出了巨大的应用潜力。然而,其默认的模型输出可能无法满足特定用户或特定场景的个性化需求。本文章的目的在于深入揭秘Stable Diffusion的模型微调技巧,让读者能够根据自己的需求对模型进行定制化调整,生成符合特定风格、主题或要求的图像。范围涵盖了从基础概念到实际操作,从理论原理到项目实战的全方位内容,旨在为读者提供一个系统且深入的学习指南。

大模型应用工坊 948

python dist_Python 安装路径, dist-packages 和 site-packages 区别

Stack Overflow's译:dist-packages is a Debian-specific convention that is also present in its derivatives, like Ubuntu. Modules are installed to dist-packages when they come from the Debian package mana...

weixin_39735166的博客 595

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

python dist_【python】dist-packages和site-packages的区别

一、dist-packages和site-packages的区别sudo apt-get install 安装的package存放在/usr/lib/python2.7/dist-packages目录中pip 或者 easy_install安装的package存放在/usr/local/lib/python2.7/dist-packages目录中手动从源代码安装的package存放在site-pa...

weixin_42255222的博客 1004

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

python 中 dist-packages 和 site-packages 的区别

python 中 dist-packages 和 site-packages 的区别 dist-packages is a Debian-specific convention that is also present in its derivatives, like Ubuntu. Modules are installed to dist-packages when they come fr

喜欢音乐的码农 6434

python 中dist-packages和site-packages的区别

dist-packages和site-packages的区别

撇开风沙 快乐奔跑 1900

【python】dist-packages和site-packages的区别

一、dist-packages和site-packages的区别 sudo apt-get install 安装的package存放在/usr/lib/python2.7/dist-packages目录中 pip 或者 easy_install安装的package存放在/usr/local/lib/python2.7/dist-packages目录中 手动从源代码安装的package...

weixin_30505043的博客 520

[Linux] python的dist-packages和site-packages

site-packages 它的位置通常在: ~/.local/lib/python2.7/site-packages 通过源安装的python是使用这个地址来查找模块的. 这样做是让系统的python模块和用户自己安装的模块分割开来, 互不影响. dist-packages 它的位置通常在: /usr/local/lib/python2.7/dist-packages 它是debian...

YasinQiu的博客 2893

python dist_python 中site-packages 和 dist-packages的区别

dist-packages is a Debian-specific convention that is also present in its derivatives, like Ubuntu. Modules are installed to dist-packages when they come from the Debian package manager into this loca...

weixin_30517215的博客 180

python 中site-packages 和 dist-packages的区别

dist-packages is a Debian-specific convention that is also present in its derivatives, like Ubuntu. Modules are installed to dist-packages when they come from the Debian package manager into this loca...

weixin_33975951的博客 509

Python 安装路径, dist-packages 和 site-packages 区别

sudo apt-get install安装的package存放在 /usr/lib/python2.7/dist-packages目录中pip 或者easy_install安装的package存放在/usr/local/lib/python2.7/dist-packages目录中手动从源代码安装的package存放在site-packages目录中The dist-packages is a D...

szw的博客 836

python中pip安装包dist-packages和site-packages的区别

pip安装包dist-packages与site-packages的区别

heze09的博客 2116

python package和目录_Python的dist-packages目录和site-packages目录的区别

sudo apt-get install安装的package存放在/usr/lib/python2.7/dist-packages目录中pip 或者easy_install安装的package存放在/usr/local/lib/python2.7/dist-packages目录中手动从源代码安装的package存放在site-packages目录中The dist-packages is a D...

weixin_39854440的博客 777

Python中site-packages和dist-packages区别

sudo apt-get install安装的package存放在/usr/lib/python2.7/dist-packages目录中 pip(对应系统安装的python)或者easy_install(对应系统安装的python)安装的package存放在/usr/local/lib/python2.7/dist-packages目录 手动从源代码安装(使用系统安装python)的packa...

u014435314的专栏 6283
上一篇: Linux--进程组、会话、守护进程
下一篇: 记PHP第几周和日期转换的坑
ECHOutopia
博客等级 码龄14年 11粉丝 29原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值