Repository: pypa/pipenv

Issue:
ImportError: No module named shutil_get_terminal_size
Describe the issue briefly here.

```
$ pipenv run python
Creating a virtualenv for this project…
Using /usr/bin/python (2.7.14) to create virtualenv…
⠋Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/user/dotfiles/dotfiles/.local/lib/python2.7/site-packages/pipenv/pew/__main__.py", line 1, in <module>
    from pipenv.patched import pew
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/patched/pew/__init__.py", line 3, in <module>
    from . import pew
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/patched/pew/pew.py", line 16, in <module>
    from backports.shutil_get_terminal_size import get_terminal_size
ImportError: No module named shutil_get_terminal_size
```

Virtualenv location:

```
Loading .env environment variables…
Warning: There was an unexpected error while activating your virtualenv. Continuing anyway…
Python 2.7.14 (default, Sep 23 2017, 22:06:14)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
```

Please run `$ python -m pipenv.help`, and paste the results here.

Pipenv version: `'11.3.2'`

Pipenv location: `'/home/user/.local/lib/python2.7/site-packages/pipenv'`

Python location: `'/usr/bin/python'`

Other Python installations in `PATH`:

  - `2.7`: `/usr/bin/python2.7`
  - `2.7`: `/usr/bin/python2.7`
  - `3.5`: `/usr/bin/python3.5m`
  - `3.5`: `/usr/bin/python3.5`
  - `3.6`: `/usr/bin/python3.6m`
  - `3.6`: `/usr/bin/python3.6`

  - `2.7.14`: `/usr/bin/python`
  - `2.7.14`: `/usr/bin/python2`
  - `3.6.3`: `/usr/bin/python3`

PEP 508 Information:

```
{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.13.0-36-generic',
 'platform_system': 'Linux',
 'platform_version': '#40-Ubuntu SMP Fri Feb 16 20:07:48 UTC 2018',
 'python_full_version': '2.7.14',
 'python_version': '2.7',
 'sys_platform': 'linux2'}
```

System environment variables:

  - `QT4_IM_MODULE`
  - `ALTERNATE_EDITOR`
  - `PYTHONDONTWRITEBYTECODE`
  - `XDG_CURRENT_DESKTOP`
  - `XDG_SESSION_TYPE`
  - `QT_IM_MODULE`
  - `LOGNAME`
  - `USER`
  - `PATH`
  - `XDG_VTNR`
  - `HOME`
  - `PYTHONUNBUFFERED`
  - `VIRTUALENVWRAPPER_SCRIPT`
  - `DISPLAY`
  - `XDG_SESSION_DESKTOP`
  - `LANG`
  - `TERM`
  - `SHELL`
  - `JOURNAL_STREAM`
  - `SESSION_MANAGER`
  - `XDG_DATA_DIRS`
  - `WAYLAND_DISPLAY`
  - `GNOME_DESKTOP_SESSION_ID`
  - `CLUTTER_IM_MODULE`
  - `TEXTDOMAIN`
  - `EDITOR`
  - `DESKTOP_AUTOSTART_ID`
  - `XMODIFIERS`
  - `_VIRTUALENVWRAPPER_API`
  - `USERNAME`
  - `WORKON_HOME`
  - `XDG_RUNTIME_DIR`
  - `SSH_AUTH_SOCK`
  - `VTE_VERSION`
  - `GDMSESSION`
  - `IM_CONFIG_PHASE`
  - `VISUAL`
  - `TEXTDOMAINDIR`
  - `GNOME_SHELL_SESSION_MODE`
  - `XDG_CONFIG_DIRS`
  - `PIP_PYTHON_PATH`
  - `LESSOPEN`
  - `XDG_SESSION_ID`
  - `DBUS_SESSION_BUS_ADDRESS`
  - `_`
  - `GTK_IM_MODULE`
  - `DESKTOP_SESSION`
  - `LESSCLOSE`
  - `OLDPWD`
  - `SHLVL`
  - `PWD`
  - `COLORTERM`
  - `XDG_MENU_PREFIX`
  - `GIT_EDITOR`
  - `LS_COLORS`
  - `PAGER`
  - `XDG_SEAT`

Pipenv–specific environment variables:


Debug–specific environment variables:

  - `PATH`: `/bin/:/bin/:/bin/:/home/user/.envs/dotfiles-_bp8OBTv/bin/:/home/user/.envs/dotfiles-_bp8OBTv/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/user/dotfiles/bin:/home/user/.local/bin`
  - `SHELL`: `/bin/bash`
  - `EDITOR`: `emacsclient -c`
  - `LANG`: `en_US.UTF-8`
  - `PWD`: `/home/user/dotfiles`


---------------------------

Contents of `Pipfile` ('/home/user/dotfiles/Pipfile'):

```toml
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]

"autopep8" = "*"
"flake8" = "*"
autoenv = "*"
click = "*"
gitpython = "*"
ipython = "*"
mypy = "*"
percol = "*"
pex = "*"
pycodestyle = "*"
pydocstyle = "*"
pyflakes = "*"
pylama = "*"
pylint = "*"
tldr = "*"
visidata = "*"
requests = "*"


[dev-packages]



[requires]


```



------------

##### Expected result

Describe what you expected.

##### Actual result

When possible, provide the verbose output (`--verbose`), especially for locking and dependencies resolving issues.

##### Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).


Pipfile

```
$ cat Pipfile 
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]

"autopep8" = "*"
"flake8" = "*"
autoenv = "*"
click = "*"
gitpython = "*"
ipython = "*"
mypy = "*"
percol = "*"
pex = "*"
pycodestyle = "*"
pydocstyle = "*"
pyflakes = "*"
pylama = "*"
pylint = "*"
tldr = "*"
visidata = "*"
requests = "*"


[dev-packages]



[requires]
```



# Platform

Ubuntu 17.10


Discussion:

Resolving patch:
diff --git a/pipenv/pew/__main__.py b/pipenv/pew/__main__.py
--- a/pipenv/pew/__main__.py
+++ b/pipenv/pew/__main__.py
@@ -1,4 +1,13 @@
 from pipenv.patched import pew
+import os
+import sys
+
+pipenv_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+pipenv_vendor = os.sep.join([pipenv_root, 'vendor'])
+pipenv_patched = os.sep.join([pipenv_root, 'patched'])
+
 
 if __name__ == '__main__':
+    sys.path.insert(0, pipenv_vendor)
+    sys.path.insert(0, pipenv_patched)
     pew.pew.pew()


Test patch: