Unable to install Swift in Ubuntu - swift

Hi I am trying to install Swift on Ubuntu (Ubuntu 15.10). I followed the guide of Apple at swift.org. But after executing all the steps when I execute following command
swift --version
It returns error saying
harshit#harshit-Linux:~/swift/usr/bin$ swift --versionThe program 'swift' can be found in the following packages:
* python-swiftclient
* python3-swiftclient
Try: sudo apt-get install <selected package>
I used
export PATH=/home/harshit/swift/usr/bin/swift:"${PATH}"
Here is my directory path
http://pastebin.com/Z1aNiDQM
Kindly help me to complete installation.

You are declaring your path like this:
export PATH=/home/harshit/swift/usr/bin/swift:"${PATH}"
but it's wrong because it includes the swift executable itself in the path.
It should be like this instead:
export PATH=/home/harshit/swift/usr/bin:"${PATH}"

It sounds like you did not add swift to your path. Do you have the direct path to where it is installed? You could try /usr/whereever/bin/swift

Related

Trying to Configure pyls through nvim-lspconfig

I'm trying to switch from vscode to neovim. I have coc.nvim configured for pyright but now neovim provides native support for language-server. So I tried to configure python-language-server. I have installed pyls by pip install python-language-server. I went through the documentation for lsp-quickstart. It says that I just need to add neovim/nvim-lspconfig to my plugins and then add lua require('lspconfig').pyls.setup{} to my init.vim. After refreshing I'm getting Error:
E5108: Error executing lua [string ":lua"]:1: attempt to index field 'pyls' (a nil value)
I tried googling it but didn't find any relevant answer. Please help me out if you've configured it.
Hey so it looks like there is a new fork of pyls. I had the same issue and the following worked for me!
See Here:
https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#pylsp
And Here:
https://github.com/python-lsp/python-lsp-server
Try:
pip install 'python-lsp-server[all]'
Then in init.vim change:
lua require('lspconfig').pyls.setup{}
to
lua require('lspconfig').pylsp.setup{}
Note: pyls changes to pylsp
Or you can install all packages with package manager in Linux, for instance:
sudo apt-get install python3-pylsp*
Notice * which will install all pylsp packages.

ViennaRNA package's Perl module RNA.pm is required

I am running a toolkit named RNA Framework that requires ViennaRNA to be installed.
I have installed the ViennaRNA 2.4.14 to run a function named rf-fold, However, I constantly receive this error:
[!] Error: ViennaRNA package's Perl module RNA.pm is required.
Please ensure that `ViennaRNA package v2.2.0` (or greater) is installed and try again
When I check the missing RNA.pm module, I can see it is in this path:
/home/user/ViennaRNA/lib/site_perl/5.28.0/
when I check which Perl I am using (type: which Perl) it gives me:
/home/user/perl5/perlbrew/perls/perl-5.28.0/bin/perl
I tried different ways to install the ViennaRNA, including conda install -c bioconda viennarna, compile and make install from ViennaRNA-2.4.14.tar.gz file from the official website. But I cannot get over this error.
I saw a similar issue here and there is a solution (https://www.perlmonks.org/?node_id=1052814), but I don't fully understand the content. Thanks in advance for any help and sorry if it is a basic question!
I think the RNA.pm come with the package, when you download ViennaRNA-2.4.14.tar.gz and install following this link.
So I found my RNA.pm is in the directory:
/share/apps/ViennaRNA-2.1.7/compile-install/lib/site_perl/5.14.2/x86_64-linux-thread-multi/RNA.pm
And I modified the PERL5LIB environment variable by :
export PERL5LIB=/share/apps/ViennaRNA-2.1.7/compile-install/lib/
Problem solved!

libpq library in centos

I'm using Centos 7 and I have a challenge find a postgresql library called libpq. I have it installed but when I run 'pkg­-config libpq --cflags --libs' I get 'No package 'libpq' found'.
when I run 'rpm -qa | grep libpq' I get this here:
libpqxx-devel-5.0.1-2.rhel7.x86_64
libpqxx-5.0.1-2.rhel7.x86_64.
What could be the issue here. Thanks in advance!
I got it working by assigning the path to the libpq library an environment variable like this:
export PKG_CONFIG_PATH=/usr/pgsql-10/lib/pkgconfig
This command will help find the correct path to the library 'locate libpq.pc'.

Swift Build no such command

python-swiftclient 3.0.0
Ubuntu 16.04.1 LTS
I type in swift build and it returns the list of swift commands and says at the end no such command. Could not find anyone describing this specific command line response.
That's because you use either python-swiftclient either your PATH is wrong.
If swift --version returns:
python-swiftclient 3.0.0
Then you aren't currently calling swift build system. Check this link and update your swift release here.
Else check that you call the right swift executable by doing:
which swift
The output is the executable you are actually calling.
Environmental variable failure
just
source ~/.bashrc
Seems that the entire swift environment is needed, so visit the swift download page, and choose your system (mine is ubuntu 18.04):
$ wget https://download.swift.org/swift-5.5.2-release/ubuntu1804/swift-5.5.2-RELEASE/swift-5.5.2-RELEASE-ubuntu18.04.tar.gz
$ tar -xf swift-5.5.2-RELEASE-ubuntu18.04.tar.gz
$ PATH=~/swift-5.5.2-RELEASE-ubuntu18.04/usr/bin:$PATH
This solution worked perfect for me.

pcap.h header file problem

anyone know how to fix the problem regarding header file in ubuntu 10.10.
I am executing a sniffing program which makes use of this header file. My system shows libcap package is installed. Still, on compiling the code, an error is coming which reads:
fatal error: pcap.h: No such file or directory
compilation terminated.
Please help me out.
Thanks all:)
The system won't let me correct Eric Fossum's comment, because I lack reputation. There is a typo ("libcap" vs. "libpcap") and his suggested command should read the following:
sudo apt-get install libpcap-dev
sudo apt-get install libpcap0.8-dev
If you are using yum, then
sudo yum install install libpcap-devel
You don't have the pcap.h file in your include path. You need to add the location of pcap.h to your include path when compiling:
-I/path/to/pcap.h
If you're using linuxbrew, you can just brew install libpcap. In my case I was trying to install nethogs and it failed with this error.
First install libpcap:
sudo apt-get install libpcap0.8-dev
then create its shortcut for header file:
ln -s /usr/include/pcap/bpf.h /usr/include/net/bpf.h