Cannot install modules via pip running on python 3.4

前端 未结 2 411
清歌不尽
清歌不尽 2021-01-14 07:50

I have been trying to install various modules that I need to have to run this script:

https://github.com/austingandy/slack-evernote/blob/master/slackwriter.py

<
2条回答
  •  醉梦人生
    2021-01-14 07:58

    While it is possible to migrate a script from Python 2 to Python 3, doing it right isn't trivial. You could try using 2to3 but I suspect it won't quite do the job.

    The easiest is to just use virtualenv with Python 2. I'm not sure how it is on Mac but on Linux you can just have both versions of Python installed in parallel and you can pick the one you need in your virtualenv as e.g.

    virtualenv -p python2 venv
    

    where python2 is your Python 2 binary and venev the directory you want tot install the virtualenv into.

    Where you might run into trouble is the activate scripts which are only available for specific shells. However, you could probably adapt one if none works out of the box.

提交回复
热议问题