Export list of installed packages in SublimeText - sublimetext3

I am aware that I can see all installed packages in Sublime using Ctrl+Shift+P and selecting Package Control: List Packages.
I have many packages installed (>20) and I need a way to export their names (and ideally also the link to their https://packagecontrol.io/ page) to a text file or similar output.
Can this be done at all?

You can easily get the list of installed packages by looking at Package Control's user preferences file: Preferences -> Package Settings -> Package Control -> Preferences - User and checking the installed_packages value.
Getting the URL as well is a bit more complicated, but can be done for example by executing the following in ST's Python console (View menu -> Show Console):
import os; [(os.path.dirname(file)[len('Packages/'):], sublime.decode_value(sublime.load_resource(file))['url']) for file in sublime.find_resources('package-metadata.json')]

The accepted answer unfortunately didn't work for me.
Then I found that in Windows 10 (at least for ST 3) you can obtain what you want by listing the files contained in
C:\Users\<your_user_name>\AppData\Roaming\Sublime Text 3\Installed Packages
But some installed packages might be missing from this list ! Crosscheck your result with the content of the directory
C:\Users\<your_user_name>\AppData\Roaming\Sublime Text 3\Packages

Install Sublime Package Control
From inside Sublime Text, open Package Control's Command Pallet: CTRL SHIFT P (Windows, Linux) or CMD SHIFT P (Mac).
Type install package, select command Package Control: Install Package and hit Return/Enter. A list of available packages will be displayed.
From inside Sublime Text, open Package Control's Command Pallet: CTRL SHIFT P (Windows, Linux) or CMD SHIFT P (Mac).
Type PackageSync, select the PackageSync package and hit Return/Enter. The package will be downloaded to the appropriate directory.

Related

Google images search API raising ModuleNotFoundError for curses on windows [duplicate]

In PyCharm, I've added the Python environment /usr/bin/python. However,
from gnuradio import gr
fails as an undefined reference. However, it works fine in the Python interpreter from the command line.
GNURadio works fine with python outside of Pycharm. Everything is installed and configured how I want it.
Gnuradio is located at /usr/local/lib/python2.7/site-packages/gnuradio
Also:
PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/lib/python2.7/site-packages/gnuradio
Adding a Path
Go into File → Settings → Project Settings → Project Interpreter.
Then press configure interpreter, and navigate to the "Paths" tab.
Press the + button in the Paths area. You can put the path to the module you'd like it to recognize.
But I don't know the path..
Open the python interpreter where you can import the module.
>> import gnuradio
>> gnuradio.__file__
"path/to/gnuradio"
Most commonly you'll have a folder structure like this:
foobarbaz/
gnuradio/
__init__.py
other_file.py
You want to add foobarbaz to the path here.
You should never need to modify the path directly, either through environment variables or sys.path. Whether you use the os (ex. apt-get), or pip in a virtualenv, packages will be installed to a location already on the path.
In your example, GNU Radio is installed to the system Python 2's standard site-packages location, which is already in the path. Pointing PyCharm at the correct interpreter is enough; if it isn't there is something else wrong that isn't apparent. It may be that /usr/bin/python does not point to the same interpreter that GNU Radio was installed in; try pointing specifically at the python2.7 binary. Or, PyCharm used to be somewhat bad at detecting packages; File > Invalidate Caches > Invalidate and Restart would tell it to rescan.
This answer will cover how you should set up a project environment, install packages in different scenarios, and configure PyCharm. I refer multiple times to the Python Packaging User Guide, written by the same group that maintains the official Python packaging tools.
The correct way to develop a Python application is with a virtualenv. Packages and version are installed without affecting the system or other projects. PyCharm has a built-in interface to create a virtualenv and install packages. Or you can create it from the command line and then point PyCharm at it.
$ cd MyProject
$ python2 -m virtualenv env
$ . env/bin/activate
$ pip install -U pip setuptools # get the latest versions
$ pip install flask # install other packages
In your PyCharm project, go to File > Settings > Project > Project Interpreter. If you used virtualenvwrapper or PyCharm to create the env, then it should show up in the menu. If not, click the gear, choose Add Local, and locate the Python binary in the env. PyCharm will display all the packages in the selected env.
In some cases, such as with GNU Radio, there is no package to install with pip, the package was installed system-wide when you install the rest of GNU Radio (ex. apt-get install gnuradio). In this case, you should still use a virtualenv, but you'll need to make it aware of this system package.
$ python2 -m virtualenv --system-site-packages env
Unfortunately it looks a little messy, because all system packages will now appear in your env, but they are just links, you can still safely install or upgrade packages without affecting the system.
In some cases, you will have multiple local packages you're developing, and will want one project to use the other package. In this case you might think you have to add the local package to the other project's path, but this is not the case. You should install your package in development mode. All this requires is adding a setup.py file to your package, which will be required anyway to properly distribute and deploy the package later.
Minimal setup.py for your first project:
from setuptools import setup, find_packages
setup(
name='mypackage',
version='0.1',
packages=find_packages(),
)
Then install it in your second project's env:
$ pip install -e /path/to/first/project
For me, it was just a matter of marking the directory as a source root.
Add path in PyCharm 2017
File -> Settings (or Ctrl+Alt+S) -> Project -> Project Interpreter
Show all
Select bottom icon on the right side
Click on the plus button to add new path to your module
My version is PyCharm Professional edition 3.4, and the Adding a Path part is different.
You can go to "Preferences" --> "Project Interpreter". Choose the tool button at the right top corner.
Then choose "More..." --> "Show path for the selected interpreter" --> "Add". Then you can add a path.
DON'T change the interpreter path.
Change the project structure instead:
File -> Settings -> Project -> Project structure -> Add content root
In PyCharm 2020.1 CE and Professional, you can add a path to your project's Python interpreter by doing the following:
1) Click the interpreter in the bottom right corner of the project and select 'Interpreter Settings'
2) Click the settings button to the right of the interpreter name and select 'Show All':
3) Make sure your project's interpreter is selected and click the fifth button in the bottom toolbar, 'show paths for the selected interpreter':
4) Click the '+' button in the bottom toolbar and add a path to the folder containing your module:
For PyCharm Community Edition 2016.3.2 it is:
"Project Interpreter" -> Top right settings icon -> "More".
Then on the right side there should be a packages icon. When hovering over it it should say "Show paths for selected interpreter". Click it.
Then click the "Add" button or press "alt+insert" to add a new path.
As quick n dirty fix, this worked for me:
Adding this 2 lines before the problematic import:
import sys
sys.path.append('C:\\Python27\\Lib\site-packages')
On Project Explorer, you can right click on the folder where the module is contained and set as 'Source'.
It will be parsed in the Index for code completion as well as other items.
I'm new to PyCharm (using 2018.3.4 CE) and Python so I rotely tried to follow each of the above suggestions to access the PIL (Pillow) package which I knew was in system-site-packages. None worked. I was about to give up for the night when I happened to notice the venv/pyvenv.cfg file under my project in the Project Explorer window. I found the line "include-system-site-packages = false" in that file and so I changed it to "true". Problem solved.
In my PyCharm 2019.3, select the project, then File ---> Settings, then Project: YourProjectName, in 'Project Interpreter', click the interpreter or settings, ---> Show all... ---> Select the current interpreter ---> Show paths for the selected interpreter ---> then click 'Add' to add your library, in my case, it is a wheel package
For me there is also another issue. If you try to add a folder that in the past had a .idea folder, but your current project has it's own .idea folder your pycharm might get confused for some reason -- even if you have the right python/conda env. For me deleting the .idea folder of the other project fixed the confusion that it could find the obviously correctly installed pkgs. Then it was it was able to find them in the pycharm editor GUI snf stopped underlyinging them in red.
Download anaconda
https://anaconda.org/
once done installing anaconda...
Go into Settings -> Project Settings -> Project Interpreter.
Then navigate to the "Paths" tab and search for /anaconda/bin/python
click apply

How to open command prompt in Atom editor?

How can I run command prompt in Atom Editor? Do I need to install any package for the same? I could not find any videos or links regarding this issue.
Go to File -> Settings -> Install
Search for package -> platformio-ide-terminal
After installation of this package
Go to Packages tab in a menu bar where you can see all the packages installed
click on platformio-ide-terminal -> New Terminal [Now you will get the terminal window]
There are 2 packages that I use to open a terminal window in Atom. They are 'platformio-ide-terminal' and Termination. Load either one of these and the name will appear under the package menu. Selecting either one will allow you to open a terminal window in bottom third of Atom window.

Issues on install package control on sublime text 3

I installed sublime text 3 and i need to install package control ..so when i refer this page.
I just confused, what should i follow,
Can anyone help me to guide this docs?
Thanks,
You just have to copy the given code in the sublime text 3 console. (Show Console in the view menu)
It will download and install the package control. (You should see notifications in the console)
Once installed, you'll have access to the package control commands in the command prompt. (You can access it by pressing ctrl + shift+ p)
In build 3126 (released Sept. '16) a menu item (and command palette entry) was introduced to easily install Package Control.
It can be found under tools -> Install Package Control or by looking up Package Control in the command menu (ctrl/cmd + shift + p).

Can't find certain package in Package control: Install Package

I can't find this package in Package control. Looks like my list is outdated.
https://github.com/babel/babel-sublime
How can i fix it?
Sublime Text 3083
I had a similar problem with a different package, this is the only result I found when searching so I'll post my answer.
I already had the package installed!
I apparently installed it previously then forgot I had done so. Check your packages list if you can't find one! Command Palette > Package Control: List Packages
Not sure what the issue with Sublime is, but if anyone else gets stuck on this you can just install from Github directly. Works for babel-sublime and should work for other packages.
1) Find the relevant repo (assuming open source)
https://github.com/babel/babel-sublime
2) Clone into your packages folder
On a mac this would be
$ cd /Users/(username)/Library/Application\ Support/Sublime\ Text\ 2/Packages/
$ git clone https://github.com/babel/babel-sublime
And that was it for me - restart Sublime Text and the package is available.
Open Package Control Options(Commad+Shift+P) and add the repository if its not exist.
Open Package Control Again and choose Install package and write the package name which in your case its (babel-sublime) and you should find it.
If you want to install babel-sublime but it is not included in package control it is in GitHub repository, it can be added manually.
Go to Preferences > Package Control
In the command palette, type Package Control: Add Repository
A text box will appear at the bottom, paste the URL to the repository, i.e. https://github.com/username/repo.
Now that you have added the GitHub repository, you can add the package as you would have originally:
Go to Preferences > Package Control
In the Command Palette, type Package Control: Install Package
In the dialog box, type the name of your package, i.e. babel-sublime Auto complete will find if it is present. If that is the case, press enter and wait for it to install, then restart sublime. It will be installed upon restart.
PS: the same way to install any package from GitHub
you can Google sublime plugins to find some really cool ones
I had to add it 2 times, each time closing. Then it finally worked and got all packages. Thats the only solution i found. Some glitch in Sublime.
Heres is info how to install full packages list https://packagecontrol.io/installation
In Sublime Text 3, go to View, Show Console. Paste in the code below and hit Enter.
import urllib.request,os,hashlib; h =
'df21e130d211cfc94d9b0905775a7c0f' +
'1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-
package'; ipp = sublime.installed_packages_path();
urllib.request.install_opener( urllib.request.build_opener(
urllib.request.ProxyHandler()) ); by = urllib.request.urlopen(
'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh =
hashlib.sha256(by).hexdigest(); print('Error validating download (got
%s instead of %s), please try manual install' % (dh, h)) if dh != h
else open(os.path.join( ipp, pf), 'wb' ).write(by)
the solution was found here:
http://www.storybench.org/install-babel-packages-sublime-text-3/
My version of Sublime Text 3 was old. I solved this problem by simply running the command:
sudo apt-get update
which will update sublime after sublime v 3.0, restarted sublime, and all was good.
open command pallette
Package Control: install package -> enter
you search Babel -> enter
good luck

Package Control no module named package_control.add_repository_channel_command

I've updated to the most recent version of Package Control for Sublimetext 3 via Git, but none of the commands work. The menu items are still present, strangely enough. When I open the log with Ctrl+`, I see this error:
ImportError: No module named 'Package Control.package_control.add_repository_channel_command'
How can I get it to work again?
Apparently the Package Control .sublime-package file is outdated, and in this case, referencing a python module that has been moved to a different python package (from package_control to package_control.commands).
This can be easily fixed by deleting Installed Packages/Package Control.sublime-package.
I use sublime text 3
From this site, I Follow these steps:
Go to http://wbond.net/sublime_packages/package_control/installation
& copy the long command there.
Open the Sublime Text 2 console by
pressing Ctrl+.
Paste the command you copied into the Sublime Text
console.
Press Enter.
After Package Control installs, restart
Sublime Text.
Then I got the error like that.
I have tried :
check ignored_packages on set but I found nothing.
Download package manager and copy it to Installed Packages, but not works.
Then I update my sublime to the newest version, then the error is gone.
That is my tips, you should try one of the steps, like what I have tried.

Resources