-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot install venv; toml.decoder.TomlDecodeError Found invalid character #3592
Comments
@kimiagharib How did you get all those garbage characters in your Pipfile(marked in red background)? |
I am having the same issue. It started after I removed my pycache in my package folder. I uninstalled pipenv and I am still hitting the same error. I removed pipenv and all associated venv's and I still cannot get it to work. Any help would be appreciated. To close this, I had a malformed Pipfile. |
Can confirm the problem is a malformed Pipfile. Just remove any listed packages. |
@kimiagharib can this be closed? It appears that the issue was a malformed Pipfile. |
I'm new to pipenv and so it's trying to convert my requirements.txt file but that file includes specific subset libraries in brackets (e.g. |
I had a similar issue [[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
chardet = "3.0.4"
Click = "7.0"
idna = "2.8"
itsdangerous = "1.1.0"
Jinja2 = "2.10.1"
python-dotenv = "0.10.3"
requests = "2.22.0"
stripe = "2.29.3"
toml = "0.9.6"
urllib3 = "1.25.3"
Werkzeug = "0.15.4"
[requires]
python_version = "3.8" I used to get this Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/bin/pipenv", line 8, in <module>
sys.exit(cli())
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/cli/command.py", line 235, in install
retcode = do_install(
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/core.py", line 1751, in do_install
pre = project.settings.get("allow_prereleases")
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/project.py", line 557, in settings
return self.parsed_pipfile.get("pipenv", {})
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/project.py", line 509, in parsed_pipfile
parsed = self._parse_pipfile(contents)
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/project.py", line 531, in _parse_pipfile
return toml.loads(contents)
File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/toml/decoder.py", line 458, in loads
raise TomlDecodeError(str(err), original, pos)
toml.decoder.TomlDecodeError: Invalid date or number (line 9 column 1 char 103) Then I solve it by not identifying the package version like this with a star in between the quotation the Github fails to show it : [[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
certifi="*"
chardet="*"
Click="*"
Flask="*"
idna="*"
itsdangerous="*"
Jinja2="*"
MarkupSafe="*"
python-dotenv="*"
requests="*"
stripe="*"
toml="*"
urllib3="*"
Werkzeug="*"
[requires]
python_version = "3.8" |
For the record: the garbage at the beginning of the OP's Pipfile is RTF formatting. |
django-webserver = {extras = ["pyuwsgi"], version = "*"} For more than 1 subset libraries, |
You need to add '==' when you specify the version
|
for me similar issue was solved by fixing the Pipfile (I had an unnecessary quotation mark in the file) |
Issue description
When creating a virtual environment, I'm able to initially create the
venv
however there is an error which occurs after it is created. I'm usingpyenv
to manage my python versions.✔ Successfully created virtual environment!
Then
toml.decoder.TomlDecodeError: Found invalid character in key name: '\'. Try quoting the key name. (line 1 column 2 char 1)
Expected result
When I run
$ pipenv install --three
I expect thevenv
to be created, and then be able to add packages to it.The things I think it might be are:
/Users/me/.pyenv/versions/3.7.1/bin/python3.7m
and I'm not sure what them
isvenv
it's looking for a Pipfile that does not exist in the project folder, but rather one directory up. And I'm not sure why it is looking there.Any help would be appreciated.
Thanks!
Actual result
Steps to replicate
I'm not sure how to recreate this beyond the steps above.
$ pipenv --support
Pipenv version:
'2018.11.27.dev0'
Pipenv location:
'/Users/me/src/pipenv/pipenv'
Python location:
'/Users/me/.pyenv/versions/3.7.1/bin/python3.7'
Python installations found:
3.7.2
:/usr/local/bin/python3
3.7.2
:/usr/local/bin/python3.7m
3.7.1
:/Users/me/.pyenv/versions/3.7.1/bin/python3
3.7.1
:/Users/me/.pyenv/versions/3.7.1/bin/python3.7m
PEP 508 Information:
System environment variables:
LDFLAGS
TERM_PROGRAM
PIPENV_PYTHON
PYENV_ROOT
TERM
SHELL
TMPDIR
Apple_PubSub_Socket_Render
TERM_PROGRAM_VERSION
TERM_SESSION_ID
PYENV_VERSION
ZSH
USER
SSH_AUTH_SOCK
PYENV_DIR
__CF_USER_TEXT_ENCODING
PAGER
LSCOLORS
PATH
PWD
LANG
ITERM_PROFILE
PYENV_HOOK_PATH
XPC_FLAGS
XPC_SERVICE_NAME
PYENV_SHELL
SHLVL
HOME
COLORFGBG
CFLAGS
ITERM_SESSION_ID
LESS
LOGNAME
LC_CTYPE
CONFIGURE_OPTS
COLORTERM
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PIP_SHIMS_BASE_MODULE
PIP_PYTHON_PATH
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
PIPENV_PYTHON
:“/Users/me/.pyenv/shims/python”
Debug–specific environment variables:
PATH
:/Users/me/.pyenv/versions/3.7.1/bin:/Users/me/.pyenv/libexec:/Users/me/.pyenv/plugins/python-build/bin:/usr/local/opt/openssl/bin:/usr/local/bin:/Users/me/.pyenv/shims:/Users/me/.pyenv/shims:/Users/me/.pyenv/bin:/usr/bin:/bin:/usr/sbin:/sbin
SHELL
:/bin/zsh
LANG
:en_CA.UTF-8
PWD
:/Users/me/project/
Contents of
Pipfile
('/Users/me/Documents/Pipfile'):The text was updated successfully, but these errors were encountered: