# PyPi deployment with Travis: Invalid or non-existent authentication

**URL:** <https://travis-ci.community/t/pypi-deployment-with-travis-invalid-or-non-existent-authentication/10217>\
**Category:** Deployment\
**Tags:** python\
**Created:** [October 20, 2020, 6:36am UTC](https://travis-ci.community/t/pypi-deployment-with-travis-invalid-or-non-existent-authentication/10217 "2020-10-20T06:36:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SolarUltima](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/solarultima/32/4019_2.png) [@SolarUltima](https://travis-ci.community/u/SolarUltima)\
**Post date:** [October 20, 2020, 6:36am UTC](https://travis-ci.community/t/pypi-deployment-with-travis-invalid-or-non-existent-authentication/10217/1 "2020-10-20T06:36:57Z")

</div>

When deploying from Travis CI to PyPi I get the following errors:

`HTTPError: 403 Client Error: Invalid or non-existent authentication information. for url: https://upload.pypi.org/legacy/`

I’ve have followed closely the Travis CI documentation for [pypi deployment](https://docs.travis-ci.com/user/deployment/pypi/) and have setup my PyPI username and password, with the it encrypted with the [password encryption docs](https://docs.travis-ci.com/user/encryption-keys#note-on-escaping-certain-symbols). The password does not have any escape-worthy characters but I’ve tried escaping all characters regardless, but I still get the error.

Nothing seems to work, any advice?

The relevant section of the Travis CI config is:

```auto
- provider: pypi
  on:
    branch: master
    tags: true
  user: "<<username>>"
  password:
    secure: "<<encrypted password>>"
  distributions: "sdist bdist_wheel"
  skip_existing: true

```

don’t want to reveal secrets on forum but I think the idea here is clear. sorry for all the questions.

SU  
Norway

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [October 20, 2020, 6:50am UTC](https://travis-ci.community/t/pypi-deployment-with-travis-invalid-or-non-existent-authentication/10217/2 "2020-10-20T06:50:43Z")

</div>

After reading this, you should explicitly run `travis encrypt` against `travis-ci.com` :

```auto
travis encrypt <<password>> --com --debug

```

The `debug` flag is inherently optional, and provides some added info in the terminal. You can also do  
verbose.

 ![Screen Shot 2020-10-19 at 11.38.55 PM](https://us1.discourse-cdn.com/flex015/uploads/travis_ci/original/2X/d/d1b947c04ed01e317fc1527e9a93ac58b0c60703.png)

If this doesn’t work try running `travis whatsup`. Let me know the results, and no need to apologize! This is what we are here for.

---

<div class="post-metadata">

**Author:** ![SolarUltima](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/solarultima/32/4019_2.png) [@SolarUltima](https://travis-ci.community/u/SolarUltima)\
**Post date:** [October 21, 2020, 8:43am UTC](https://travis-ci.community/t/pypi-deployment-with-travis-invalid-or-non-existent-authentication/10217/3 "2020-10-21T08:43:04Z")

</div>

hey @montana this work when I ran travis-encrypt as suggested

---

<div class="post-metadata">

**Author:** ![jackyjoy123](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jackyjoy123/32/7234_2.png) [@jackyjoy123](https://travis-ci.community/u/jackyjoy123)\
**Post date:** [October 2, 2021, 3:26pm UTC](https://travis-ci.community/t/pypi-deployment-with-travis-invalid-or-non-existent-authentication/10217/4 "2021-10-02T15:26:33Z")

</div>

thanks for the awesome information.
