简体   繁体   English

从版本python2.6.6的位置导入pandas

[英]Importing pandas from a location for version python2.6.6

I installed pandas 0.16.2 using this command 我使用这个命令安装了pandas 0.16.2

pip install --target /myfolder [packages] pip install --target / myfolder [packages]

Now, i want to write a python script to import pandas from the /myfolder 现在,我想写一个python脚本从/ myfolder导入pandas

My code 我的代码

import imp
pd  =imp.load_source('pandas.name','/mnt/gfsusr/software/python_modules/pandas')
pd

I expect that the pd variable above contains all the methods of pandas. 我希望上面的pd变量包含pandas的所有方法。

import sys
sys.path.append('/mnt/gfsusr/software')

from python_modules import pandas as pd

The code above will extend the sys path to include the file you want to import. 上面的代码将扩展sys路径以包含要导入的文件。

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

相关问题 python2.6.6安装问题 - python2.6.6 installation problem 在OSX Snow Leopard上安装IPython以使用非默认的python版本(即python2.6.6 / python2.7) - Installing IPython to work with a non-default python version (i.e python2.6.6/python2.7) on OSX Snow Leopard ValueError:Python2.6.6格式的零长度字段名称 - ValueError: zero length field name in format in Python2.6.6 python pyodbc-在Windows / python2.7上连接到SQL Server 2008,但不在centOS6.32 / python2.6.6上连接 - python pyodbc - connecting to sql server 2008 on windows/python2.7 but not on centOS6.32/python2.6.6 python2.6.6将apache日志时间戳转换为epoch以来的秒数(unix样式) - python2.6.6 Convert apache log timestamp to seconds since epoch (unix style) 使用Python2.6.6打开.svn / wc.db时出现“格式错误的数据库架构” - Got “malformed database schema” while open .svn/wc.db Using Python2.6.6 将默认 python 版本从 2.6.6 更改为 2.7 并配置 django - Change default python version from 2.6.6 to 2.7 and also configure django 在python 2.6.6中导入pylab时出错 - Error when importing pylab in python 2.6.6 Python-在python 2.6.6版本中安装Argpath的问题 - Python - Issue in Installing Argpath for python 2.6.6 version python 2.6.6 可以使用哪个版本的 pylint? - Which version of pylint can be used with python 2.6.6?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM