Run Scheme Program in Sublime Text Ubuntu - scheme

I tried to run a program using scheme syntax but I couldn't. I got this ...
[Errno 2] No such file or directory: 'gsi'
[cmd: ['gsi', '-:d-', '/home/salinas/Documents/LP/scheme.scm']]
[dir: /home/salinas/Documents/LP]
[path: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" :/home/salinas/.rvm/bin]
[Finished]
Anyone knows how to solve this ?

If you want to use the configured Scheme environment (Gambit) you need to install it. Open a terminal (CTRL+ALT+T) and enter the following:
sudo apt-get intall gambc
Then gsi should be available.
If it doesn't work because the package was not found you may need to enable universe repositories and try again.

Related

Sublime Text 3 ; Conda Environment

I am extremely new to creating environments, and i'm having issues setting the directory path to the correct location. I have Anaconda install on this machine.
By default, it looks like it is going here:
[Errno 2] No such file or directory:
'/Users/examplename/anaconda3/bin/python' [cmd:
['/Users/examplename/anaconda3/bin/python', '-u',
'/Users/examplename/Desktop/python_work/test_pyenvironment.py']] [dir:
/Users/examplename/Desktop/python_work] [path:
/usr/bin:/bin:/usr/sbin:/sbin]
When my anaconda file location is actually in:
'MacintoshHD/anaconda3/bin/python'
Does anyone know how I can change where Sublime Text is looking, when trying to find this root folder? I'm not too sure about the PATH either, 'usr/bin:/bin:etc.' doesn't seem right?
Considering you are using your main anaconda env with pandas installed, you need to set a build system for your anaconda env. Like in this answer and mine you need to go to Tools ▶ Build System ▶ New Build System and set your custom build system:
{
"shell_cmd": "~/anaconda3/bin/python -u $file",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
}
And to use this custom build you have to select either Tools ▶ Build System ▶ Automatic or Tools ▶ Build System ▶ <your-custom-build-system-name> before building your code and/or to satisfy the Anaconda package for sublime.

How to write a Python 3 script to do .\activate in Windows 10 OS?

I'm trying to write a script to activate the virtual environment under a path, which is doing the same thing as the following command line:
cd C:\go\to\my\venv\path\Scripts
.\activate
My idea is first to change the directory to my Scripts folder, then execute the .\activate file. The problem is I have tried
1. os.system(".\\activate") #".\activate" is an error
2. subprocess.run(".\\activate")
3. subprocess.call(".\\activate")
4. subprocess.Popen(".\\activate", shell=True)
but all failed, and because I'm new to Python 3, so any suggestion will be appreciated, thanks.
Update 1:
Right now, it seems like can install one package successfully, but I have a list of packages need to install and I will figure it out how to do it. When I print out os.getcwd() after I activated the venv, there is no (venv) as the prefix in the result, so I don't know if the package was installed under venv or not?
Update 2:
Now, my problem is I'm using from pip._internal import main as pip
pip(['install', package_name])
It only can install one package successfully, if I pass a list of packages and use for loop to install them then they will fail. The error will be
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\Users\BO7D71~1.CHE\AppData\Local\Temp\pip-req-tracker-1nc0ofuc\5fc2bc8999692b42fb54fd13e7cbdf5f855b9718f5363d30a270bbe1'
Update 3:
Problem solved!

Sublime Text 2 - BeautifyRuby don't work

i've installed BeautifyRuby in my Sublime Text 2 (running OS X Yosemite 10.10), but is not working, I receive this message when I try to cmd + ctrl + k:
Error: invalid output. Check your ruby interpreter settings
I've changed, as suggested https://github.com/CraigWilliams/BeautifyRuby , the sublime-settings file with:
"ruby": "/Users/alessiogastaldo/.rbenv/bin/ruby"
and also using the specific version:
"ruby": "/Users/alessiogastaldo/.rbenv/versions/1.8.7-p371/bin/ruby"
but with no success.
I've read the different solutions proposed (like https://github.com/CraigWilliams/BeautifyRuby/issues/52) but nothing works.
Anyone do know how to solve this?
I had the same problem too.
I solved with this:
In terminal, run the command: which ruby.
Copy the result. In my case was: "/home/user/.rbenv/shims/ruby"
Open your package settings. In my case: Preferences > Package Settings > BeautyfyRuby > Settings Default.
Add this line in the file: "ruby": "/home/user/.rbenv/shims/ruby",
You will need to install the htmlbeautifier gem.
Run the commmand in terminal: gem install htmlbeautifier
It works for me.

Wordnet::Similarity installation issue

When I install Wordnet::Similarity on mac, the following error occur:
usr/local/bin/perl "-Iblib/arch" "-Iblib/lib" build/Depthfiles.PL blib/lib/WordNet/synsetdepths.dat
Generating default depth files.
Can't load '/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle' for module Digest::SHA1: dlopen(/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle, 1): no suitable image found. Did find:
/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle: mach-o, but wrong architecture at /usr/local/lib/perl5/5.8.8/darwin-2level/DynaLoader.pm line 230.
at blib/lib/WordNet/Tools.pm line 76
Compilation failed in require at blib/lib/WordNet/Tools.pm line 76.
My attempt was to enter to the downloaded package directory from terminal and type:
perl Makefile.PL
make
make test
sudo make install
I made sure to have installed all prerequisite http://search.cpan.org/dist/WordNet-Similarity/doc/install.pod#Prerequisites. I suspect that this may be due to mac processor version with Perl interface. Any suggestion on how to fix this?
Install libdigest-sha-perl in Ubuntu 14.04 has solved this issue.
Download link:http://packages.ubuntu.com/trusty/amd64/perl/libdigest-sha-perl

Error -60005 when install Cocos2d-iPhone v3 RC4

When I try to install Cocos2d-iphone 3.0.0 RC4, I got an error: (run without sudo)
Error -60005 occurred while executing script with privileges.
So, I try to show its package content and use terminal to do: cd ...Cocos2D Installer 3.0.0.app/Contents/MacOS
I try this command: (with sudo)
sudo ./Cocos2D\ Installer\ 3.0.0
It works but I got log with some errors:
[1m>>> Installing Cocos2D-v3.0.0 files (B[m
[1m>>> Installing Cocos2D-v3.0.0 templates (B[m
[4m[1mCocos2D Template Installer (Cocos2D-v3.0.0)(B[m
Error: [31m✖︎(B[m Script cannot be executed as root.
In order for it to work properly, please execute the script again without 'sudo'.
If you want to know more about how to use this script execute '/Users/viethung/Downloads/Cocos2D-v3.0.0/install.sh --help'.
[1m>>> Building/Installing Cocos2D-v3.0.0 documentation, this may take a minute.... (B[m
appledoc version: 2.2 (build 963)
Generation step 4/5 failed: GBDocSetInstallGenerator failed generating output, aborting!
Documentation set was installed, but couldn't reload documentation within Xcode.
Xcode got an error: No documentation set present at specified path.
[1m>>> Cocos2D-v3.0.0 installation complete! (B[m
Are there any way is better than this way?
I have same problem.
I think you installed old cocos2d-iphone and it caused this problem.
You should remove old cocos2d-iphone first. I removed:
~/Library/Developer/Xcode/cocos2d v3.x
And install again. It works for me.
Hope it works for you :)

Resources