0

I've seen questions similar to this but haven't found a workable answer. I'm looking to learn more about Python coding, I've been coding a lot with Ruby, but would like to use Python for some 3rd Party modules which don't seem to have a Ruby equivalent. RVM and gems made 3rd party really easy to work with, is there an equivalent for Python? I've installed Python through Macports and Homebrew, and have tried to install 3rd party modules through Macports ('sudo port install') and pip. Although the modules seem to install successfully, I can't get any non-standard modules to run in Sublime Text.

On the Sublime Text side, I managed to get Python to build by creating a new build system based on suggestions from here

"shell_cmd": "$project_path/vi_sys_pkgs/bin/python3 -u \"$file\"",
"path": "$project_path/vi_sys_pkgs/bin",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"

and also by using the Sublime-REPL package. I've also read that virtualenv is a common way to utilize 3rd party modules, as it will prevent conflicts.

So my question is, How can I get Python to run in Sublime Text like Ruby did. How can I set up Sublime text so that it points to the correct directory where 3rd party modules are installed, so that it can build something that includes one of these modules. I'm guessing there are multiple ways to do this, I'm just looking for the most straightforward approach.

Any tips appreciated, thanks in advance

jackmac92
  • 75
  • 1
  • 8
  • 1
    What do you mean by "run in Sublime Text"? Sublime Text can both interface with the system Python and use its internal Python, so what you're doing matters quite a bit. – Veedrac Sep 20 '14 at 00:06
  • I mean having the ability to write a python script that utilizes a 3rd party module in Sublime Text, and then Build it within sublime text. – jackmac92 Sep 20 '14 at 20:38
  • Oh; that sounds like it should just work. I'm not familiar enough with OSX to know why it hasn't. – Veedrac Sep 20 '14 at 21:22
  • Possible duplicate of [Running Code with Python 3.5.0 + Sublime 3.0 on Mac](https://stackoverflow.com/questions/33205895/running-code-with-python-3-5-0-sublime-3-0-on-mac) – jwpfox Jan 05 '18 at 10:14

0 Answers0