Sublime text python portable

Portable Environment Setup

This is very small portable python for windows. We will configure portable sublime text to use it.

portable_sublime_python.png

  1. Extract the portable python into a folder like Portable_PySub.
  2. Extract portable sublime text into that folder also.

Sublime Text

portable_sublime_python_build_system1.png

  1. In windows Sublime Text find python path from system variables. Since we are using portable version of python, so there is no python path in the system variables. We need to manually locate the path into sublime. In sublimetext open preference-> browse package , got to User folder and create a file Python_Portable.sublime-build there. Open the file in text editor and add the following lines:
 "cmd": ["D:/Portable_PySub/Portable Python-3.8.6 x64/App/Python/python.exe", "-u", "$file"], "file_regex": "^[ ]File \"(. )\", line (4*)", "selector": "source.python" "shell": true > 

portable_sublime_python_build_system2.pngSave it and restart sublimetext.

  • Go to tool-> build system .You will see new entry called Python_portable , select and build it. portable_sublime_python_build_system.pngportable_sublime_python2.png
  • Installing Additional Packages

    Use PIP

    portable_sublime_python_pip.png

    Using pip in Console-Launcher.exe residing in portable python folder, you can install packages.

    Running Jupyter Notebook

    use python -m

    After installing jupyter run the following command in Console-Launcher.exe

    python -m jupyter notebook 

    Источник

    Portable IDE in Windows: SublimeText, WinPython and Kite

    All about data

    If the size of the Anaconda gives you a headache then you may use WinPython distribution which requires less space. After installing some of the ml libraries the installation size of Anaconda goes up to 12GB while WinPython takes only around 3GB. WinPython provides a way to the portable installation as well. A portable setup has some advantages. For example, if you reinstall the operating system, you don’t need to set up the environment again from scratch.

    In order to setup portable python environment for machine learning we need the following things

    1. Python Interpreter (WinPython)
    2. Python library for ML (WinPython)
    3. Code Editor (Sublime text) supporting linting, auto completion and themes.

    WinPython

    WinPython includes both python interpreter and libraries for machine learning as Anaconda distribution do. However, unlike Anaconda distribution, WinPython supports portable installation.

    Download WinPython and unzip it into your desired location. I unzipped it into

    Register WinPython to the Operating System. Add the following paths into the system variables.

    D:\AI\Programming\WinPython D:\AI\Programming\WinPython\scripts D:\AI\Programming\WinPython\python-3.8.1.amd64 D:\AI\Programming\WinPython\python-3.8.1.amd64\Scripts D:\AI\Programming\WinPython\python-3.8.1.amd64\libs

    Now start cmd and type: (if cmd is already open, restart it)

    Where python Python --version

    The above output confirms the successful installation of WinPython. We are now ready to install some machine learning libraries using PIP command.

    PIP

    PIP command is used to maintain the python libraries just like conda is used in Anaconda. Open command prompt and type the following commands:

    Install Packages

    Uninstall Packages

    Display installed packages

    Sublime Text

    Download and extract portable version of sublime text into your preferred location. Start sublime text and check build system as python:

    Tools > Build System > python

    Sublime Linter

    Linting is the process of checking the source code for Programmatic as well as Stylistic errors. Linting highlights syntactical and stylistic problems in your Python source code, which oftentimes helps you identify and correct subtle programming errors or unconventional coding practices that can lead to errors. For example, linting detects the use of an uninitialized or undefined variable, calls to undefined functions, missing parentheses, and even more subtle issues such as attempting to redefine built-in types or functions.

    Install flake8
    Install SublimeLinter from package control

    Press ctr+shift+p to open package control and select package control: install package

    Configure sublime Linter

    Open sublime text settings. preference > package settings > sublime linter > settings
    Add the following into user setting.

    // SublimeLinter Settings - User < "show_panel_on_save": "never", "gutter_theme": "Packages/Theme - Monokai Pro/Monokai Pro.gutter-theme", "styles": [ < "mark_style": "outline", "priority": 1, "scope": "region.orangish", "icon": "warning", "types": [ "warning" ] >, < "mark_style": "squiggly_underline", "priority": 1, "scope": "region.redish", "icon": "error", "types": [ "error" ] >] >

    Auto completion: Kite

    Kite is an AI-based autocompletion tool for Python. It uses machine learning to help you with the suggestions for keywords while coding in Python. Kite will automatically install plugins for sublime text.

    Источник

    Using Sublime Text 2 with Portable Python

    I ran into the same problem and after a bit of troubleshooting, here is my solution:

    This build will open your program in Python Portable. Instead of specifying your flash drive letter, using «\» will go to the path relative to the root of the current drive.

    2) At the end of your code add the following line to prevent force closing:

    Also, don’t forget to import the «os» module:

    • Sublime Text 3 Build Python Code with virtualenv
    • Using cx_freeze to create executable of Python code with additional text files
    • Python — Draw text or image on top of background image with relative positioning using Pillow
    • How to get contents of a text box using selenium with python
    • How to read all text with tag by using ElementTree for python
    • Check for Dead Links on soundcloud using text file with Python
    • How to test text nodes rendered with React using Selenium Python
    • How to replace text in curly brackets with another text based on comparisons using Python Regex
    • Build a python file using Sublime Text 2 in an external terminal
    • saving a structure of a list with the data in a text file using Python
    • Find a line of text with a pattern using Windows command line or Python
    • How to extract text from a string with Python using indexing and slicing
    • using lxml and requests in python to grab text between certain tags with a specific class name
    • find the most common length of text line in a file with various line sizes present using python
    • How do I open Python scripts using Sublime Text from terminal
    • Finding a strings in a text using regular expressions with Python
    • Replace section of text with only knowing the beginning and last word using Python
    • Getting text with accented characters using Python and Selenium
    • Issue with an «is_prime» python function on Sublime Text
    • Extracting strings starting with symbols and combining with others from a text using python
    • Trouble running Python script with crontab on macOS using Anaconda3
    • Print a few wanted lines from text with Python
    • How to print a backspace character with python using repl.it
    • How to load a text or csv file which is in a different parallele directory using a python script when i do not have access to absolute path
    • File transfer with Tar piped through SSH using python
    • Print out text with dynamic pieces in Python to the Terminal
    • Want to re-tweet with a message using Python
    • How to run python code with params using Java, ./AdafruitDHT.py 22 4
    • Score short quote in text with Python
    • How to authenticate self signed certificate with password using Python requests
    • ImportError: No module named builtins with PyHive using Python 2.7
    • Working with debugger/ terminal view in Sublime Text (Python) gives incorrect indentation errors
    • Simple text cleaning python 3.6 script not giving correct output on executing the script using cmd prompt on windows 10
    • Using python random.choice in combination with list.append()
    • Using while and if in python to create a game fueled by a text file
    • How to stream data into Google Cloud BigQuery using Appengine with Python Script-flowing data from API?
    • Sending emails using outlook with Python — Overcoming Azure Information Protection Classifications
    • Comparing 2 CSV files using python with different rows
    • using google APIs with python to make folders encountered error
    • Wrtie a file to a new file with addition text based on criteria within source file in python
    • Using Chrome Driver with Selenium webdriver.Remote Python
    • replacing lines with different values in text file in python
    • Making my first request to an API with a token using python 3.6
    • Mass Delete All Files starting with “DirsToDelete” using python
    • Using ffmpeg with subprocess python
    • How do I use python and selenium to find the element of a radio button using the text related to the radio button?
    • How do you break a Loop with a key press without using a module that is not built in to python
    • Python 3 / Outlook mailer issue using win32com.client. Fails after responding to first message with ‘item moved or deleted’
    • extract a paragraph from a aeronautical text using python
    • Reading email body text using python 3.6

    More Query from same tag

    • Reading data from CSV using pandas
    • Error while trying to run command with subprocess
    • urllib.error.HTTPError: HTTP Error 403: Forbidden with urllib.requests
    • Calculation of sum in python
    • Why do I get Unbound Local Error?
    • Cant find module even though its installed and can run
    • How to use exception handling in a loop (for n iterations) in python so that results are stored in a file but loop doesn’t terminate?
    • Python — Passing Functions with Arguments as Arguments in other Functions
    • Indentation issue python
    • Pulp with Real Numbers in Python
    • python interpreter on non-pydev projects?
    • Executing script from Alexa trigger
    • How to properly configure coloring for mandelbrot set using python?
    • Django extending user model and displaying form
    • iOS Push: Can’t find problematic token
    • ImportError: No module named abc | Odoo 10 | Python 2.7
    • How can I convert a list of hexadecimal strings to a single string with escape characters?
    • for loop through stdin using previous item
    • How to assertRaises a specific exception
    • why «in» generator is much faster than «in» list in python
    • Django with Apache working for admin page but gives 404 for all other urls
    • Error in calculation of inbuilt MS-SSIm function in tensorflow
    • Trouble with «Do you want to continue?» type cases in Python
    • Filtering fields from a RetrieveAPIView in the serializer
    • Set a mongo database in pymongo without eval(). Maybe setattr()?
    • how to sum lists in lists pairwise in python and put this sum in a new list
    • How can I show arbitrary pages based oy the URL requested in CherryPy?
    • Convert map array json to csv
    • Python math domain error on distance formula
    • Regex and verbose in python 3
    • How to add comments in Python code with break-lines?
    • How to use for cycles in functional programming?
    • Removing ‘#’ from the scraped links
    • Tuple to List Python
    • this code in python about finding the longest sub-string , i need explaination

    Источник

    Читайте также:  Метод создания глубокой копии java
    Оцените статью