操作系统:Mac OS X 10.7.5 Python版本:2.7.5

我已经从https://pypi.python.org/pypi/setuptools用ez_setup.py安装了setuptools 1.0 然后我从https://pypi.python.org/pypi/pip/1.4.1下载pip.1.4.1 pkg。

在iTerm中运行(sudo) python setup.py install即可显示

running install
running bdist_egg running egg_info writing requirements to
pip.egg-info/requires.txt writing pip.egg-info/PKG-INFO writing
top-level names to pip.egg-info/top_level.txt writing dependency_links
to pip.egg-info/dependency_links.txt writing entry points to
pip.egg-info/entry_points.txt warning: manifest_maker: standard file
'setup.py' not found

reading manifest file 'pip.egg-info/SOURCES.txt' writing manifest file
'pip.egg-info/SOURCES.txt' installing library code to
build/bdist.macosx-10.6-intel/egg running install_lib warning:
install_lib: 'build/lib' does not exist -- no Python modules to
install

creating build/bdist.macosx-10.6-intel/egg creating
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/PKG-INFO -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying pip.egg-info/SOURCES.txt ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/dependency_links.txt ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/entry_points.txt ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/not-zip-safe ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/requires.txt ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/top_level.txt ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO creating
'dist/pip-1.4.1-py2.7.egg' and adding
'build/bdist.macosx-10.6-intel/egg' to it removing
'build/bdist.macosx-10.6-intel/egg' (and everything under it)
Processing pip-1.4.1-py2.7.egg removing
'/Users/dl/Library/Python/2.7/lib/python/site-packages/pip-1.4.1-py2.7.egg'
(and everything under it) creating
/Users/dl/Library/Python/2.7/lib/python/site-packages/pip-1.4.1-py2.7.egg
Extracting pip-1.4.1-py2.7.egg to
/Users/dl/Library/Python/2.7/lib/python/site-packages pip 1.4.1 is
already the active version in easy-install.pth Installing pip script
to /Users/dl/Library/Python/2.7/bin Installing pip-2.7 script to
/Users/dl/Library/Python/2.7/bin

Installed
/Users/dl/Library/Python/2.7/lib/python/site-packages/pip-1.4.1-py2.7.egg
Processing dependencies for pip==1.4.1 Finished processing
dependencies for pip==1.4.1

然后我输入pip install,错误信息是这样的

Traceback (most recent call last):   File
"/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 9,
in <module>
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()   File "build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 357, in
load_entry_point   File
"build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 2394, in
load_entry_point   File
"build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 2108, in
load ImportError: No module named pip

谁以前遇到过同样的问题,能给我一些解决方法吗?

我如何使用杰克逊JSON映射与Java 8 LocalDateTime?

jsonmappingexception:不能实例化类型[简单类型,java.time类]的值。LocalDateTime] from JSON字符串;没有单字符串构造函数/工厂方法(通过引用链:MyDTO["field1"]->SubDTO["date"])

这可能吗?安装pip时,将python包安装在我的$HOME文件夹中。(例如,我想安装mercurial,使用pip,但在$HOME而不是/usr/local)

我使用的是一台mac机器,只是考虑了这种可能性,而不是“污染”我的/usr/local,我将使用我的$HOME。

PEP370就是这样的。就是创建一个~ /。做一个pip安装包足以使这些包只安装在我的$HOME文件夹?

如何使用pip安装Python的MySQLdb模块?

我想在pip需求文件中为几个包添加注释。(只是解释一下为什么这个包在清单上。)我能这样做吗?

我在想象

Babel==0.9.5 # translation
CherryPy==3.2.0 # web server
Creoleparser==0.7.1 # wiki formatting
Genshi==0.5.1 # templating

我安装了最新版本的Python(3.6.4 64位)和最新版本的PyCharm(2017.3.3 64位)。然后我在PyCharm (Numpy, Pandas等)中安装了一些模块,但当我尝试安装Tensorflow时,它没有安装,我得到了错误消息:

无法找到一个满足需求的版本 没有找到匹配的TensorFlow分布。

然后我尝试从命令提示符安装TensorFlow,我得到了同样的错误消息。 不过,我确实成功安装了tflearn。

我也安装了Python 2.7,但我再次得到相同的错误消息。我在谷歌上搜索了这个错误,并尝试了一些建议给其他人的东西,但都不起作用(这包括安装Flask)。

如何安装Tensorflow?谢谢。

当我试图使用Jackson序列化一个非常简单的对象时,我得到了一个异常。错误:

jsonmappingexception:没有找到序列化器 类MyPackage。TestA和没有属性 发现以创建BeanSerializer(为避免异常,禁用 SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS))

下面是要序列化的简单类和代码。

有人能告诉我为什么我得到这个错误吗?

public class TestA {
    String SomeString = "asd";
}

TestA testA = new TestA();
ObjectMapper om = new ObjectMapper();
try {
    String testAString = om.writeValueAsString(testA); // error here!

    TestA newTestA = om.readValue(testAString, TestA.class);
} catch (JsonGenerationException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
} catch (JsonMappingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
} catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

pip install——help:

--user  Install to the Python user install directory for your platform. 
        Typically ~/.local/, or %APPDATA%\Python on Windows. 
        (See the Python documentation for site.USER_BASE for full details.)

现场文档。USER_BASE是一个有趣的*NIX主题的可怕虫洞,我不理解。

简单地说,用户的目的是什么?为什么要安装到~/。本地/重要吗?为什么不把一个可执行文件放在我的$PATH中?

我正在尝试用pip安装一些软件包。

但pip安装展开给我

命令“python setup.py egg_info”失败,错误码为1 C:\Users\马可的~ 1 \ AppData \ \ Temp \ pip-build-wa7uco0k \展开\

我怎么解决这个问题?

我想知道是否有任何方法告诉pip,特别是在需求文件中,安装一个同时具有最小版本(pip install package>=0.2)和不应该安装的最大版本(理论api: pip install package<0.3)的包。

I ask because I am using a third party library that's in active development. I'd like my pip requirements file to specify that it should always install the most recent minor release of the 0.5.x branch, but I don't want pip to ever try to install any newer major versions (like 0.6.x) since the API is different. This is important because even though the 0.6.x branch is available, the devs are still releasing patches and bugfixes to the 0.5.x branch, so I don't want to use a static package==0.5.9 line in my requirements file.

有什么办法可以做到吗?