Could not install packages due to an EnvironmentError

Dear Colleagues,

I am facing a challange while trying to update my package. I execute the following command to upgrade the package
pip install --user --upgrade lhcsmapi
Lately, I started receiving an error message preventing from completing the upgrade.


The work around I found is to execute the command again. In case that fails, I uninstall the package
pip uninstall lhcsmapi
and install it again
pip install --user lhcsmapi
What is the advised way for updating packages. Is there anything that I could do to avoid this issue.

Thank you in advance for your help.

Cheers, Michał.

Dear Michał,

Thank you for reporting your issue.
Unfortunately, I am not able to reproduce what you saw while upgrading lhcsmapi.

Here you have an example upgrading pillow from 6.0.0 to latest (6.2.2)

bash-4.2$ pip install --user --upgrade Pillow
Collecting Pillow
  Downloading https://files.pythonhosted.org/packages/12/ad/61f8dfba88c4e56196bf6d056cdbba64dc9c5dfdfbc97d02e6472feed913/Pillow-6.2.2-cp27-cp27mu-manylinux1_x86_64.whl (2.1MB)
     |████████████████████████████████| 2.1MB 3.8MB/s
Installing collected packages: Pillow
Successfully installed Pillow-c

Similarly, I have tried it to install an old version of lhcsmapi, which I did not have before

bash-4.2$ pip install --user lhcsmapi==1.0.4
Collecting lhcsmapi==1.0.4
Installing collected packages: lhcsmapi
Successfully installed lhcsmapi-1.0.4

And the upgrade to latest went smooth:

bash-4.2$ pip install --user --upgrade lhcsmapi
Collecting lhcsmapi
Installing collected packages: lhcsmapi
  Found existing installation: lhcsmapi 1.0.4
    Uninstalling lhcsmapi-1.0.4:
      Successfully uninstalled lhcsmapi-1.0.4
Successfully installed lhcsmapi-1.2.70

Did this happen only once or you can reproduce it consistently?

Thanks!
Enrico

Hi Enrico,

thank you for your prompt reply. Actually, I can reproduce it quite consistently, and other team members also suffer from this issue.

Cheers, Michał.

Dear Michał,

Could you please provide me with a list of the dependencies that you have installed (pip list will do the job)?
This will give me a more precise idea of what is needed to update the package and I can try to reproduce the problem more accurately.
If you do not want to post the list here, feel free to open a ticket via Service Now.

Cheers,
Enrico

Dear Enrico,

many thanks for the follow-up. The list below. In principle we need tqdm, influxdb, tzlocal.

Cheers, Michał.

bash-4.2$ pip list
Package Version Location


  •                              csmapi
    

-hcsmapi 1.2.66
absl-py 0.7.1
AGILe 1.4.1
ansiwrap 0.8.4
asn1crypto 0.24.0
astor 0.8.0
astroid 2.2.5
atomicwrites 1.3.0
attrs 19.1.0
backcall 0.1.0
backports-abc 0.5
backports.functools-lru-cache 1.5
backports.lzma 0.0.13
backports.shutil-get-terminal-size 1.0.0
backports.ssl-match-hostname 3.7.0.1
bcrypt 3.1.6
bleach 3.1.0
cachetools 3.1.1
certifi 2019.3.9
cffi 1.12.2
chardet 3.0.4
Click 7.0
cloudpickle 1.2.1
cmmnbuild-dep-manager 2.1.3
configparser 3.7.4
control dev
CouchDB 1.2
coverage 4.5.3
cpymad 1.2.1 /cvmfs/sft.cern.ch/lcg/views/LCG_96python3/x86_64-centos7-gcc8-opt/lib/python3.6/site-packages
cryptography 2.7
cx-Oracle 7.1.3
cycler 0.10.0
Cython 0.29.10
dask 0+unknown
decorator 4.3.2
defusedxml 0.6.0
dill 0.2.9
distributed 1.28.1
Django 2.2.1
elasticsearch 6.3.0
entrypoints 0.3
funcsigs 1.0.2
future 0.17.1
gast 0.2.2
GDAL 2.4.0
Genshi 0.7
google-auth 1.6.3
gosam 2.0.4-12f4de9
grpcio 1.21.1
h5py 2.9.0
HeapDict 1.0.0
hepdata-converter 0.1.34
hepdata-validator 0.1.16
hspy 1.6.4
html5lib 1.0.1
hypothesis 4.24.3
idna 2.8
iminuit 1.3.6
importlib-metadata 0.18
importlib-resources 1.0.2
influxdb 5.2.3
ipaddress 1.0.22
ipykernel 5.1.1
ipython 7.5.0
ipython-genutils 0.2.0
ipywidgets 7.4.2
isort 4.3.20
jedi 0.13.3
Jinja2 2.10.1
joblib 0.13.2
JPype1 0.6.3
jsonschema 3.0.1
jupyter 1.0.0
jupyter-client 5.2.4
jupyter-console 6.0.0
jupyter-contrib-core 0.3.3
jupyter-contrib-nbextensions 0.5.1
jupyter-core 4.4.0
jupyter-highlight-selected-word 0.2.0
jupyter-latex-envs 1.4.4
jupyter-nbextensions-configurator 0.4.1
Keras 2.2.4
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
kiwisolver 1.0.1
kubernetes 9.0.0
lazy-object-proxy 1.3.1
LHAPDF 6.2.3
lhcsmapi 1.2.70
llvmlite 0.29.0
logilab-common 1.4.2
lxml 4.3.3
M2Crypto 0.34.0
Markdown 3.1.1
MarkupSafe 1.0
matplotlib 3.1.0
mccabe 0.6.1
messaging 1.1
metakernel 0.24.2
minrpc 0.0.11
mistune 0.8.4
mock 3.0.5
more-itertools 7.0.0
mpmath 1.1.0
msgpack 0.6.1
multiprocess 0.70.7
nbconvert 5.5.0.dev0
nbformat 4.4.0
networkx 2.3
nose 1.3.7
notebook 5.7.8
numba 0.44.0
numexpr 2.6.9
numpy 1.16.4
oauthlib 3.0.1
octave-kernel 0.31.0
OWSLib 0.17.1
packaging 19.0
pandas 0.24.2
pandocfilters 1.4.2
papermill 1.2.1
paramiko 2.4.2
parso 0.4.0
pathlib2 2.3.3
pathos 0.2.3
patsy 0.5.1
pbr 5.2.1
pexpect 4.7.0
pickleshare 0.7.5
Pillow 6.0.0
pip 19.1.1
pjlsa 0.0.14
pkgconfig 1.5.1
pluggy 0.12.0
pox 0.2.5
ppft 1.6.4.9
prettytable 0.7.2
professor2 X.Y.Z
prometheus-client 0.7.0
prompt-toolkit 2.0.9
protobuf 3.6.1
psutil 5.6.2
ptyprocess 0.6.0
py 1.5.4
py2neo 4.3.0
py4j 0.10.7
pyarrow 0.13.0
pyasn1 0.4.5
pyasn1-modules 0.2.5
pycairo 1.18.1
pycparser 2.19
pydot 1.4.1
pydot-ng 2.0.0
Pygments 2.4.2
PyHEADTAIL 1.13.1
pyjapc 2.0.4
pylint 2.3.1
PyNaCl 1.3.0
pyparsing 2.4.0
pyproj 2.1.3
PyQt5 5.12
PyQt5-sip 4.19.15
PyRDF 0.0.1
pyrsistent 0.15.2
pyserial 3.4
pystan 2.19.0.0
pytest 4.6.2
pytest-runner 5.1
python-dateutil 2.8.0
python-gitlab 1.8.0
python-prctl 1.7
python-vxi11 0.9
pytimber 2.7.0
pytz 2019.1
pyxrootd 4.9.1
PyYAML 5.1
pyzmq 18.0.1
qmtest 2.4.1
qtconsole 4.5.1
QtPy 1.7.1
redis 3.2.1
requests 2.22.0
requests-oauthlib 1.2.0
rise 5.5.0
rivet 3.0.1
root-numpy 4.8.0
rootpy 1.0.1
rpy2 3.0.4
rsa 4.0
scandir 1.10.0
scikit-learn 0.21.2
scipy 1.3.0
seaborn 0.9.0
Send2Trash 1.5.0
setuptools 41.0.0.post20190615
setuptools-scm 3.3.3
Shapely 1.6.4.post2
simplegeneric 0.8.1
simplejson 3.16.1
singledispatch 3.4.0.3
six 1.12.0
sortedcontainers 2.1.0
SQLAlchemy 1.2.10
statsmodels 0.9.0
stomp.py 3.1.3
sympy 1.4
tblib 1.4.0
tenacity 6.0.0
tensorboard 1.14.0
tensorflow 1.14.0
tensorflow-estimator 1.14.0
termcolor 1.1.0
terminado 0.8.2
testpath 0.4.2
textwrap3 0.9.2
Theano 1.0.4
toolz 0.9.0
tornado 5.1.1
tqdm 4.41.1
traitlets 4.3.2
typed-ast 1.3.5
tzlocal 2.0.0
uncertainties 3.0.3
urllib3 1.25.3
vcversioner 2.16.0.0
wcwidth 0.1.7
webencodings 0.5.1
websocket-client 0.56.0
Werkzeug 0.15.4
wheel 0.33.4
widgetsnbextension 3.3.0
wrapt 1.11.1
xgboost 0.90
yoda 1.7.7
zict 0.1.4
zipp 0.5.1

I can confirm, as this happens for me too:

bash-4.2$ pip install --user --upgrade lhcsmapi

Collecting lhcsmapi

  Downloading https://files.pythonhosted.org/packages/7d/7a/2baef7104f88c0708a7089fa5ea03bad6e64c0c73e77a7a8fa476a0ba9f4/lhcsmapi-1.2.74.tar.gz (1.2MB)
    100% |████████████████████████████████| 1.2MB 797kB/s
Building wheels for collected packages: lhcsmapi
  Running setup.py bdist_wheel for lhcsmapi ... done
  Stored in directory: /tmp/pmrowczy/.cache/pip/wheels/88/76/35/ecdf97e7324473b30cd36517c48076c3648917af8e7a78f30d
Successfully built lhcsmapi
py2neo 4.0.0 requires colorama, which is not installed.
py2neo 4.0.0 requires neo4j-driver>=1.6.0, which is not installed.
paramiko 2.4.0 requires bcrypt>=3.1.3, which is not installed.
paramiko 2.4.0 requires cryptography>=1.5, which is not installed.
paramiko 2.4.0 requires pyasn1>=0.1.7, which is not installed.
paramiko 2.4.0 requires pynacl>=1.0.1, which is not installed.
keras 2.2.0 has requirement keras_applications==1.0.2, but you'll have keras-applications 1.0.6 which is incompatible.
keras 2.2.0 has requirement keras_preprocessing==1.0.1, but you'll have keras-preprocessing 1.0.5 which is incompatible.
Installing collected packages: lhcsmapi
  Found existing installation: lhcsmapi 1.1.110
    Uninstalling lhcsmapi-1.1.110:
Could not install packages due to an EnvironmentError: [Errno 5] Input/output error: '/eos/home-i04/p/pmrowczy/.local/lib/python3.6/site-packages/lhcsmapi/analysis/DiodeLeadResistanceAnalysis.py'