question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: invalid syntax (core.py, line 178) when trying to import chainladder package

See original GitHub issue

I have created a reprex Project (https://rstudio.cloud/spaces/54476/project/1055533) in RStudioCloud with a virtual environment for Python3. When I try to load the chainladder package previously installed within that environment, it receives the following error message in RStudioCloud;-

> reticulate::repl_python()
Python 3.5.2 (/cloud/project/NSS/bin/python)
Reticulate 1.14.9001 REPL -- A Python interpreter in R.
>>> import chainladder as cl
SyntaxError: invalid syntax (core.py, line 178)

Here is the R script;-

install.packages("devtools")
devtools::install_github("rstudio/reticulate")
library(reticulate)
virtualenv_create("NSS", python = "/usr/bin/python3")
virtualenv_install('NSS', 'chainladder')
use_virtualenv('NSS', required = T)

Here is the Python script;-

import chainladder as cl

This works satisfactorily on my desktop version of R/RStudio. Any suggestions, please?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jbogaardtcommented, Mar 23, 2020

No worries, I do claim python 3.5 compatibility so I should keep the tutorials that way too.

0reactions
aegertoncommented, Mar 24, 2020

Thanks very much again @jbogaardt

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: invalid syntax (core.py, line 178) when trying to ...
SyntaxError : invalid syntax (core.py, line 178) when trying to import chainladder package ... I have tried to create a reprex Project (https:// ......
Read more >
How can I fix SyntaxError: invalid syntax/ import * from modbus?
In verion 1 of main.py you would see Imported module my_imports in the output but your code would fail when you try to...
Read more >
Development Tutorial — Reserving in Python
The chain ladder method is based on the strong assumptions of independence across origin periods and across valuation periods. Mack developed tests to...
Read more >
"pip install" causes SyntaxError: invalid syntax [Solved]
If you get a SyntaxError: invalid syntax when trying to install a module using ... the specific package, you can import it and...
Read more >
Read the Docs Documentation
Read the Docs will try to build the documentation of your project right after you ... Install our python package before building the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found