swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.5k stars 10.35k forks source link

[SR-2743] Incomplete install instructions for Ubuntu #45347

Open Bouke opened 8 years ago

Bouke commented 8 years ago
Previous ID SR-2743
Radar None
Original Reporter @Bouke
Type Bug
Environment Swift 3.0 GM, Swift 4.0.2
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 9 | |Component/s | | |Labels | Bug, Website | |Assignee | None | |Priority | Medium | md5: c299a808f90d17978665ba28d5c425ac

relates to:

Issue Description:

If the package libpython2.7-dev is not installed, the following error is thrown when running swift:

...swift/usr/bin/lldb: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

This was on both a fresh Ubuntu server 14.04 and 16.04, with OpenSSH in addition to the default options. Solution; the installation instructions on the site should also instruct to install libpython2.7-dev.

Update: Additionally, if libcurl3 is not installed, which it isn't by default on Ubuntu Server, then a different and more cryptic error may occur: the REPL may emit "error: Couldn't lookup symbols" errors when trying to import Foundation and other libraries. Unlike the libpython error, this one gives no clue as to what is missing. (See SR-2744 for full details.)

belkadan commented 8 years ago

@trfiala, do we really need libpython-dev or can we get away with a non-dev package?

swift-ci commented 7 years ago

Comment by Mason Mark (JIRA)

On a fresh installation of Ubuntu 16.04, installing the non-dev libpython2.7 package fixed this issue for me:

sudo apt-get install libpython2.7

(Using Swift 3.0.2.)

swift-ci commented 7 years ago

Comment by Valdimar Bjorn Asgeirsson (JIRA)

In addition to the above, I found that I needed to install libcurl3 in order to get swift 3.0.2 to run on Ubuntu LTS 16.04.2.

sudo apt-get install libcurl3

swift-ci commented 7 years ago

Comment by efe ertugrul (JIRA)

Same issue here.
On a fresh installation of ubuntu16.04.
After installed swift-3.1.1-RELEASE-ubuntu16.04 i get the same error.

sudo apt-get install libpython2.7-dev
Worked for me

Bouke commented 7 years ago

Can we at least update the website's install instructions? We still depend on libpython2.7 and libcurl3 on Ubuntu 16.04.

swift-ci commented 6 years ago

Comment by Michael Koukoullis (JIRA)

This is still an issue, an update to the website instructions would be helpful. The following four packages are required to get Swift 4.0.3 running on Ubuntu 16.04

apt-get -y install clang libicu-dev libpython2.7 libcurl3
swift-ci commented 6 years ago

Comment by Addison Webb (JIRA)

This is still an issue for Swift 4.1 (swift-4.1-RELEASE) running on Ubuntu 16.04. Updated documentation on Swift.org would be nice 🙂

swift-ci commented 6 years ago

Comment by Dawei (JIRA)

Just ran into this trying to install Swift 4.2-DEVELOPMENT-SNAPSHOT....on Ubuntu 16.04

swift-ci commented 6 years ago

Comment by Tim Nelson (JIRA)

Just ran into the same error:
...swift/usr/bin/lldb: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
This happened on fresh installs of:

Ubuntu 16.04.5

swift-4.1.3-RELEASE-ubuntu16.04.tar

Installing libpython2.7-dev fixed the issue for me. Only after did I see in the comments that installing libpython2.7 would maybe fix it as well. No issues here needing to install libcurl3 so maybe that was fixed?

swift-ci commented 6 years ago

Comment by Michael Koukoullis (JIRA)

FWIW this is a bash script I use to provision Ubuntu machines in AWS so they can run Swift https://github.com/kouky/swift-aws-ec2/blob/master/user-data.sh

The broader context for that bash script is a terraform recipe for getting Swift up and running on AWS, checkout the README in the repo https://github.com/kouky/swift-aws-ec2

swift-ci commented 5 years ago

Comment by Tony Grue (JIRA)

In addition to libpython2.7-dev I found I also needed libcurl4 for Swift 4.2.3 which has changed since Michael's post above.