Skip to content

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

Open

Description

@Bouke
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:

  • SR-2744 Errors when running REPL on Ubuntu 16.04

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.)

Activity

  1. belkadan commented on Sep 23, 2016

    @belkadan
    Contributor

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

  2. swift-ci commented on Jan 19, 2017

    @swift-ci
    Contributor

    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.)

  3. swift-ci commented on Mar 1, 2017

    @swift-ci
    Contributor

    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

  4. swift-ci commented on May 6, 2017

    @swift-ci
    Contributor

    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

  5. Bouke commented on Aug 27, 2017

    @Bouke
    ContributorAuthor

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

  6. swift-ci commented on Feb 20, 2018

    @swift-ci
    Contributor

    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
  7. swift-ci commented on Apr 5, 2018

    @swift-ci
    Contributor

    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 🙂

  8. swift-ci commented on Jun 17, 2018

    @swift-ci
    Contributor

    Comment by Dawei (JIRA)

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

  9. swift-ci commented on Aug 19, 2018

    @swift-ci
    Contributor

    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?

  10. swift-ci commented on Aug 20, 2018

    @swift-ci
    Contributor

    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

  11. swift-ci commented on Mar 15, 2019

    @swift-ci
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.† websiteArchive • This issue was supposed to belong in the swift-org-website repository

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions