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.

subprocess.run AttributeError occurred in Python 3.4

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Environment

  • Poetry version: 0.12.17
  • Python version: 3.4.8
  • OS: Ubuntu 16.04.6 LTS in travis ci

https://travis-ci.org/HttpRunner/HttpRunner/jobs/557941936

Issue

Description

AttributeError occurred in Python 3.4, because the subprocess.run() function only exists in Python 3.5 and newer.

$ poetry install -v
                                          
[AttributeError]           
'module' object has no attribute 'run'  
                                          
Exception trace:
 /home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/cleo/commands/base_command.py in run() at line 136
   self.initialize(input_, output_)
 /home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/poetry/console/commands/env_command.py in initialize() at line 18
   current_env = Env.get(self.poetry.file.parent)
 /home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/poetry/utils/env.py in get() at line 227
   return VirtualEnv(prefix, base_prefix)
 /home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/poetry/utils/env.py in __init__() at line 483
   self._base = Path(self.run("python", "-", input_=GET_BASE_PREFIX).strip())
 /home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/poetry/utils/env.py in run() at line 539
   return super(VirtualEnv, self).run(bin, *args, **kwargs)
 /home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/poetry/utils/env.py in run() at line 373
   output = subprocess.run(
install [--no-dev] [--dry-run] [-E|--extras EXTRAS] [--develop DEVELOP]
The command "poetry install -v" failed and exited with 1 during .

How to Reproduce

View the detail logs in travis CI job.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
debugtalkcommented, Jul 25, 2019

Python 3.4 was EOL 2019-03-18. See here: https://devguide.python.org/devcycle/#end-of-life-branches

@bertjwregeer I agree. Thus the README should say Poetry supports 2.7 and 3.5+😁

Sent with GitHawk

0reactions
stale[bot]commented, Nov 20, 2019

Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting an error - AttributeError: 'module' object has no ...
The subprocess.run() function only exists in Python 3.5 and newer. It is easy enough to backport however: def run(*popenargs, **kwargs): input ...
Read more >
subprocess.run AttributeError occurred in Python 3.4 #1223
AttributeError occurred in Python 3.4, because the subprocess.run() function only exists in Python 3.5 and newer.
Read more >
Issue #1: Use subprocess.run - pag
This was raised by the reviewer in the package review. The run() function was added in Python 3.5; if you need to retain...
Read more >
AttributeError: module 'subprocess' has no attribute 'run'
Hi, I'm using Python 3.6.5 and trying to excute commands on A Linux ... error "AttributeError: module 'subprocess' has no attribute 'run'".
Read more >
https://docs.python.org/3.4/library/subprocess.html
No information is available for this page.
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