javascript

java

python

c#

android

c++

node.js

php

html

jquery

ios

reactjs

css

.net

git

ruby-on-rails

sql

c

ruby

string

node.js-在OSX上安装和运行MongoDB

如果有人可以在这里提供一些见解,我将不胜感激。

我是MongoDB的新手,(相对)命令行的新手。

我有一个在本地MongoDB上成功运行的express / node.js应用程序,但是在重新启动计算机后,我尝试重新启动Mongo服务器,它开始出现错误,无法启动。 从那时起,我几次重新安装Mongo只是为了发现发生相同的错误。 这是我收到的:

privee:mongodb-osx-x86_64-2.4.6 jonlinton$ ./bin/mongo
MongoDB shell version: 2.4.6
connecting to: test
Mon Aug 26 14:48:47.168 Error: couldn't connect to server 127.0.0.1:27017 at     src/mongo/shell/mongo.js:145
exception: connect failed

我错过了一步吗? 我应该创建一个配置文件吗? 一些基本指南将非常有帮助。 预先感谢您的任何见解。

trans by 2019-09-28T18:48:31Z

python-Mac + virtualenv + pip + postgresql =错误:找不到pg_config可执行文件

我试图为教程安装postgres,但是pg_config给我错误:

pip install psycopg

我得到一小段错误:

Error: pg_config executable not found.

Please add the directory containing pg_config to the PATH

or specify the full executable path with the option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

我的virtualenv中的pg_config在哪里? 如何配置呢? 我使用virtualenv是因为我不想在系统范围内安装postgres。

trans by 2019-09-28T11:23:23Z

macos-如何在Mac OS X上安装JRE 1.7并将其与Eclipse一起使用?

我想使用从Oracle网站下载的JRE 1.7。

所以我正确安装了.pkg文件,当我在终端中尝试JavaSE-1.7 (unbound)时,我得到了:

Java版本“ 1.7.0_11” Java(TM)SE运行时环境(内部版本   1.7.0_11-b21)Java HotSpot(TM)64位服务器VM(内部版本23.6-b04,混合模式)

但是在Eclipse中,我只能使用JRE 1.6。 当我进入“属性”>“ Java构建路径”>“添加库”>“ JRE系统库”时,找不到1.7(只有一个选项:JavaSE-1.7 (unbound),出现此问题:

工作区中没有与指定的执行环境兼容的JRE:JavaSE-1.7

我该怎么办 ? 谢谢

trans by 2019-09-27T06:57:53Z

iPhone-iTunes Connect API

iTunes Connect是否有API? 某些应用程序如何将财务和销售报告下载到计算机? 是否有一些C / Objective-C API包装器?

trans by 2019-09-26T07:51:44Z

macos-OS X的Bash脚本绝对路径

我正在尝试获取OS X上当前正在运行的脚本的绝对路径。

我看到很多答复都针对readlink -f $0。但是,由于OS X的readlink与BSD相同,因此它根本不起作用(它与GNU版本兼容)。

有没有现成的解决方案吗?

trans by 2019-09-25T21:37:38Z

macos-如何在终端中使用vim?

如何在OS X的终端中设置并开始使用vim?

我想开始在终端而不是单独的文本编辑器中使用vim编写C代码。 如何开始呢?

这些基础知识包括:使用vim通过终端打开,创建,保存文件,以及使用vim编写代码。 另外,是否可以在终端中直接使用vim进行编译?

trans by 2019-09-25T17:24:42Z

可可-如何将NSImage保存为新fi

如何在特定目录中将NSImage保存为新文件(png,jpg,...)?

trans by 2019-09-25T16:17:44Z

VMware上的macOS无法识别iOS设备

我正在VMWare中使用Mac OS进行iOS应用程序开发。

更新OS和Xcode后,iOS设备不可用,因此我无法对其进行测试。

将设备插入PC时,该设备在VMware中显示为已连接并标有绿点。 但是,它不会出现在Xcode的设备中。

我正在使用Mac OS 10.11。 有人有想法吗?

trans by 2019-09-25T11:15:54Z

使用Delphi XE2在MacOS中不显示Webview

我已经开始转换Webview接口以在Delphi中使用。 我设法加载了Webkit库,并且调用的接口方法似乎正常工作,但是,我似乎无法在主窗体上显示Webview。

下面是我声明的接口

  WebFrameClass = interface(NSObjectClass)
  ['{7BE750C8-DFEC-4870-851A-12DBCB0B78F6}']
  end;

  WebFrame = interface(NSObject)
  ['{BCFA04BE-41AB-4B78-89C0-3330F12C7695}']
    procedure loadRequest(request: NSURLRequest); cdecl;
  end;
  TWebFrame = class(TOCGenericImport<WebFrameClass, WebFrame>)  end;

  WebViewClass = interface(NSViewClass)
  ['{0D9F44B7-09FD-4E35-B96E-8DB71B9A2537}']
    {class} function canShowMIMEType(MIMEType: NSString): Boolean; cdecl;
  end;

  WebView = interface(NSView)
  ['{C36D8016-2FCB-49F0-BA1C-C9913A37F9AC}']
    procedure clos; cdecl;
    procedure setHostWindow(hostWindow: NSWindow); cdecl;
    function initWithFrame(frame: NSRect; frameName: NSString; groupName: NSString): Pointer; cdecl;
    function mainFrame: WebFrame; cdecl;
  end;
  TWebView = class(TOCGenericImport<WebViewClass, WebView>)  end;

以下是构建WebView的代码:

procedure TForm2.Button1Click(Sender: TObject);
var
  PWebView: Pointer;
  FwkMod: HMODULE;
  MyWebView: WebView;
  urlStr: NSURL;
  urlreq: NSURLRequest;
const
  WebKitFWK: string = '/System/Library/Frameworks/WebKit.framework/WebKit';
begin
  FwkMod := System.SysUtils.LoadLibrary(PWideChar(WebKitFWK));
  PWebView := TWebView.Alloc.initWithFrame(MakeNSRect(10, 10, 300, 300), nil, nil);
  MyWebView := TWebView.Wrap(PWebView);

  urlStr := TNSURL.Create;
  urlstr.initWithString(NSSTR('http://google.com.au/'));
  urlreq := TNSURLRequest.Create;
  urlreq.initWithURL(urlstr);
  MyWebView.mainFrame.loadRequest(urlreq);
end;

代码执行时不会引发任何异常,但是只是不想出现。 在Delphi中需要做些什么? 我为目标C找到的示例似乎很简单:

我见过一些客观的C示例,其中提到了IBOutlets。 看起来这与Delphi无关。

如何使WebView OSX Xcode项目在启动时加载URL?

谢谢。

trans by 2019-09-25T03:10:20Z

mysql-如何关闭此ssh隧道?

我按照本文中的描述打开了一个ssh隧道:Zend_Db:如何通过SSH隧道连接到MySQL数据库?

但是现在我不知道我实际上做了什么。 此命令会影响服务器上的任何内容吗?以及如何关闭此隧道,因为现在我无法正确使用本地mysql。

我使用OSX Lion,并且服务器在Ubuntu 11.10上运行。

trans by 2019-09-25T00:52:13Z

macos-我想在终端中禁用提示音-Mac OSX

我想在终端中禁用蜂鸣声。 我无法在首选项中找到禁用蜂鸣声的选项。 你能帮我吗?

-cherryhitech

trans by 2019-09-24T18:17:27Z

macos-mongodb数据库在m上的位置

我对mac和mongodb都是新手。

我有一个奇怪的疑问,访问在Mac上使用mongodb创建的数据库?

我知道,在Windows中有一个名为c:\ data \ db的文件夹,其中存储了我的数据库文件。

在Mac中如何以及在哪里存储数据库。

我记得做类似的事情

sudo mkdir -p /data/db
sudo chown `id -u` /data/db

在Mac上创建这样的文件夹,但是尽管我创建了数据库,但在此文件夹中没有找到任何数据库文件。

Mac上的数据库文件保存在哪里?

任何帮助将非常感激。

trans by 2019-09-24T06:21:32Z

macos-如何切换到使用Homebrew安装的ruby 1.9.3?

我已经使用自制软件安装了ruby 1.9.3

酿造安装红宝石

但是仍使用默认1.8.7。 如何切换osx以使用1.9.3作为默认红宝石?

trans by 2019-09-24T05:31:53Z

macos-为Mac OS X创建好的dmg“安装程序”

我已经制作了第一个用于Mac OS X的Qt应用程序。现在,我想创建一个漂亮的.dmg文件,使用户可以轻松地安装它。 我在考虑类似Firefox的东西(见图):enter image description here

我对此完全陌生,所以我什至不知道从哪里开始。

trans by 2019-09-23T22:59:37Z

可可粉-Objective-C中的舍入数字

我正在尝试对数字进行舍入并转换为字符串,以增强Objective-C程序的输出。

我有一个浮点值,我想四舍五入到最接近的.5,然后用它来设置标签上的文本。

例如:

1.4将是以下字符串:1.5

1.2将是以下字符串:1

0.2将是一个字符串:0

我花了一段时间在Google上寻找答案,但是作为Objective-C的菜鸟,我不确定要搜索什么! 因此,我非常感谢朝着正确方向的指针!

谢谢,灰

trans by 2019-09-23T11:40:40Z

python-pip无法正确安装软件包:权限被拒绝

这个问题在这里已有答案:

  • 无法在Mac OS X 10.9上安装Lxml                                     22个答案
  • django安装:无法使用pip在Linux上安装django(ubuntu)                                     3个答案

我正在尝试安装lxml在Mac(v 10.9.4)上安装scrapy

╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  pip install lxml
Downloading/unpacking lxml
  Downloading lxml-3.4.0.tar.gz (3.5MB): 3.5MB downloaded
  Running setup.py (path:/private/var/folders/8l/t7tcq67d34v7qq_4hp3s1dm80000gn/T/pip_build_ishaantaylor/lxml/setup.py) egg_info for package lxml
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.0.
    Building without Cython.
    Using build configuration of libxslt 1.1.28

    warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
  Running setup.py install for lxml
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.0.
    Building without Cython.
    Using build configuration of libxslt 1.1.28
    building 'lxml.etree' extension
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/var/folders/8l/t7tcq67d34v7qq_4hp3s1dm80000gn/T/pip_build_ishaantaylor/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
    cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.9-intel-2.7/lxml/etree.so
    building 'lxml.objectify' extension
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/var/folders/8l/t7tcq67d34v7qq_4hp3s1dm80000gn/T/pip_build_ishaantaylor/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.objectify.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.objectify.o -w -flat_namespace
    cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.objectify.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.9-intel-2.7/lxml/objectify.so
    error: could not create '/lib/python2.7/site-packages/lxml': Permission denied
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/8l/t7tcq67d34v7qq_4hp3s1dm80000gn/T/pip_build_ishaantaylor/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/8l/t7tcq67d34v7qq_4hp3s1dm80000gn/T/pip-_xm20j-record/install-record.txt --single-version-externally-managed --compile:
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'

  warnings.warn(msg)

Building lxml version 3.4.0.

Building without Cython.

Using build configuration of libxslt 1.1.28

running install

running build

running build_py

creating build

creating build/lib.macosx-10.9-intel-2.7

creating build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/_elementpath.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/builder.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/cssselect.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/doctestcompare.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/ElementInclude.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/sax.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/usedoctest.py -> build/lib.macosx-10.9-intel-2.7/lxml

creating build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/includes

creating build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/builder.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/clean.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/defs.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/diff.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/formfill.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/html5parser.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/soupparser.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron

copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron

copying src/lxml/lxml.etree.h -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/lxml.etree_api.h -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/includes/c14n.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/config.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/schematron.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/tree.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/uri.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xpath.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xslt.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/etree_defs.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/rng

copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/rng

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl

copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl

copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

running build_ext

building 'lxml.etree' extension

creating build/temp.macosx-10.9-intel-2.7

creating build/temp.macosx-10.9-intel-2.7/src

creating build/temp.macosx-10.9-intel-2.7/src/lxml

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/var/folders/8l/t7tcq67d34v7qq_4hp3s1dm80000gn/T/pip_build_ishaantaylor/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace

cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.9-intel-2.7/lxml/etree.so

building 'lxml.objectify' extension

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/var/folders/8l/t7tcq67d34v7qq_4hp3s1dm80000gn/T/pip_build_ishaantaylor/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.objectify.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.objectify.o -w -flat_namespace

cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.objectify.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.9-intel-2.7/lxml/objectify.so

running install_lib

creating /lib/python2.7/site-packages/lxml

error: could not create '/lib/python2.7/site-packages/lxml': Permission denied

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/8l/t7tcq67d34v7qq_4hp3s1dm80000gn/T/pip_build_ishaantaylor/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/8l/t7tcq67d34v7qq_4hp3s1dm80000gn/T/pip-_xm20j-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/8l/t7tcq67d34v7qq_4hp3s1dm80000gn/T/pip_build_ishaantaylor/lxml
Storing debug log for failure in /Users/ishaantaylor/Library/Logs/pip.log

如果有人可以帮助我,我将不胜感激! 我怀疑这个问题与python的多个版本有关,但是我不确定如何检查或修复它。

编辑1:当我尝试STATIC_DEPS=true sudo pip install lxml时:

╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  sudo pip install lxml
Traceback (most recent call last):
  File "/bin/pip", line 7, in <module>
    from pip import main
ImportError: No module named pip

编辑2:当我尝试STATIC_DEPS=true sudo pip install lxml

╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  STATIC_DEPS=true sudo pip install lxml
Traceback (most recent call last):
  File "/bin/pip", line 7, in <module>
    from pip import main
ImportError: No module named pip

另外,我尝试用pip安装另一个软件包,但也没有用..见下文:

╭─ishaantaylor@Ishaans-MacBook-Pro.local /lib/python2.7/site-packages
╰─➤  pip install requests
Downloading/unpacking requests
  Downloading requests-2.4.1-py2.py3-none-any.whl (458kB): 458kB downloaded
Installing collected packages: requests
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 671, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 901, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 215, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 205, in clobber
    os.makedirs(destdir)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/lib/python2.7/site-packages/requests'
Storing debug log for failure in /Users/ishaantaylor/Library/Logs/pip.log

编辑4:试图下载virtualenv,人们建议将此作为sudo的替代。 结果如下:

╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  pip install virtualenv                                                               127 ↵
Downloading/unpacking virtualenv
  Downloading virtualenv-1.11.6-py2.py3-none-any.whl (1.6MB): 1.6MB downloaded
Installing collected packages: virtualenv
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 671, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 901, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 215, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 209, in clobber
    shutil.copy2(srcfile, destfile)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 130, in copy2
    copyfile(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/lib/python2.7/site-packages/virtualenv.py'

Storing debug log for failure in /Users/ishaantaylor/Library/Logs/pip.log

编辑5:

╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  sudo pip install virtualenv                                                            1 ↵
Password:
Traceback (most recent call last):
  File "/bin/pip", line 7, in <module>
    from pip import main
ImportError: No module named pip
╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  pip install virtualenv                                                                 1 ↵
Downloading/unpacking virtualenv
  Downloading virtualenv-1.11.6-py2.py3-none-any.whl (1.6MB): 1.6MB downloaded
Installing collected packages: virtualenv
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 671, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 901, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 215, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 209, in clobber
    shutil.copy2(srcfile, destfile)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 130, in copy2
    copyfile(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/lib/python2.7/site-packages/virtualenv.py'

Storing debug log for failure in /Users/ishaantaylor/Library/Logs/pip.log

编辑6:响应hd1:

╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  curl -kLso /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  sudo python get-pip.py
python: can't open file 'get-pip.py': [Errno 2] No such file or directory

编辑7:响应hd1:

╭─ishaantaylor@Ishaans-MacBook-Pro.local /
╰─➤  curl -kLso /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
╭─ishaantaylor@Ishaans-MacBook-Pro.local /
╰─➤  cd ~
╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  sudo python /tmp/get-pip.py
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg
Cleaning up...
╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  sudo pip install virtualenv
Downloading/unpacking virtualenv
  Downloading virtualenv-1.11.6-py2.py3-none-any.whl (1.6MB): 1.6MB downloaded
Installing collected packages: virtualenv
Successfully installed virtualenv
Cleaning up...
╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  mkdir -p ~/.virtualenvs
╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  virtualenv ~/.virtualenvs/lxmltest
Traceback (most recent call last):
  File "/bin/virtualenv", line 7, in <module>
    from virtualenv import main
ImportError: No module named virtualenv
╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  which virtualenv                                                       1 ↵
/bin/virtualenv
╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤ echo -e ${PATH//:/\\n}
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/opt/X11/bin
trans by 2019-09-23T06:26:33Z

macos-如何加快向左和向右箭头键的编辑文本?

是我自己,还是其他人发现MacOS上的向左和向右箭头键编辑文本的速度异常慢?

与我的Windows计算机相比,在Mac上用左右箭头键定位光标的时间似乎是原来的两倍。 向上/向下箭头似乎足够快,但是向左/向右箭头只是爬行。 我在终端机中注意到最多,可以编辑最近使用的命令,现在在浏览器形式的文本中注意到它。

我可以设置Mac首选项来加快对这些键的响应吗?

trans by 2019-09-22T19:50:57Z

macos-OS X终端快捷方式:跳转至lin的开头/结尾

我知道我可以使用Ctrl + A和Ctrl + E跳到OS X终端中一行的开头和结尾。但是我很习惯使用编辑器中的Cmd + Right箭头和Cmd + Left箭头进行跳转, 我也想在终端上使用此快捷方式。

我尚未在Google上找到解决方案,因此也许有人可以提供帮助。

更新

就像在评论中一样,我尝试了OS X终端中的解决方案。OS X Terminal中是否有任何一种方法来逐字移动光标?

不幸的是,终端设置似乎不包含Cmd作为修改键,如您在此处看到的:

Modifier Keys of Terminal

trans by 2019-09-22T11:39:33Z

macos-如何在Xcode 8中创建删除行键盘快捷键? Xcode 3解决方案无法正常工作

Xcode 6.1 GM Seed 2的早期版本中,可以创建键绑定以删除当前行。 存在不同的解决方案,例如,在此处进行描述:

Xcode:删除行热键

Xcode重复/删除行

[http://bigdiver.wordpress.com/2009/09/11/configure-homeend-key-bidings-on-mac-os-x/]

[http://www.betadesigns.co.uk/Blog/2010/02/03/custom-xcode-shortcuts/]

所有解决方案都包括修改以下文件之一:

〜/库/应用程序支持/ Xcode /键绑定/*.pbxkeys
〜/资源库/键绑定/ DefaultKeyBinding.dict
〜/资源库/键绑定/ PBKeyBinding.dict

[http://cocoasamurai.blogspot.com/2011/03/xcode-4-keyboard-shortcuts-now.html]是Xcode 6.1 GM Seed 2中现有快捷方式的一个很好的资源。 列出了许多有关删除的内容,但没有列出“删除行”。

但是,这些解决方案自Xcode 6.1 GM Seed 2起不起作用。

更新:问题仍然与Xcode 6.1 GM Seed 2相同

更新:问题仍然与Xcode 6.1 GM Seed 2相同

更新:截至2016年4月26日仍适用于Xcode 7.3(7D175)

更新:六年后,Xcode 8.3具有内置解决方案。 请参阅下面的答案。

trans by 2019-09-22T10:20:39Z

终端 - 命令行工具bash(git)无法正常工作 - macOS Sierra最终发布坦诚

我刚刚从OS X 10.11“El Capitan”升级到10.12:“Sierra”,当我尝试访问终端内的git命令时,我收到以下错误:

xcrun:错误:无效的活动开发人员路径

(/ Library / Developer / CommandLineTools),缺少xcrun:

/库/开发商/ CommandLineTools在/ usr/ bin中/ xcrun

如果有人有解决方案,请帮助我。

trans by 2019-09-20T12:51:22Z