python常见问题

1、why should I make a copy of a data frame in pandas
2、Python 标准输出 sys.stdout 重定向
3、Homebrew,加载包失败
Psycopg2 install with pip works but cannot import module on OS X 10.9

OS X comes with Python 2.7.5 already; when you install Python with Homebrew, it puts a newer version in a different place without touching the built-in one. Homebrew’s Python also comes with Pip, whereas OS X’s doesn’t. What’s going on here is, you’re using Homebrew’s pip to install psycopg2, then running OS X’s python and trying to import it.

Run /usr/local/bin/python (the full path to Homebrew’s Python), and try import psycopg2 from there.

If that works, you need to put /usr/local/bin before /usr/bin in your PATH variable, so that your shell finds Homebrew’s Python before the OS X one every time. If you use Bash (the default shell in OS X), you can do this by putting the following in your .bash_profile:

    原文作者:异想派
    原文地址: https://www.jianshu.com/p/91f9d4feecc2
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞