Repository: spyder-ide/spyder

Issue:
Update to 3.2.5 with pip fails for Python 2.7 as it pulls pyqt5 
## Description of your problem
Hello there,

So far, working with spyder has been great. I have been using spyder 3.2.4. Today, when the update message for spyder 3.2.5 came in, I tried upgrading to it. But, it failed because it has pyqt5 as a requirement. (I have pyqt4 for python2 and pyqt5 for python3 and as far as I know pyqt5 is very glitchy and not completely compatible with python2)

I also have python3.6 on my computer, which is a windows 7, I tried upgrading the spyder on python3 and that worked without a hitch.

**What steps will reproduce the problem?**

![spyder](https://user-images.githubusercontent.com/4919060/34395460-adedc082-eb60-11e7-85cf-b1867d1be1d4.PNG)

Just try installing or upgrading spyder using pip (Python 2.7.14 (32bit), Windows 7, Current spyder version: 3.2.4)

I have never had a problem with upgrades for Python2 so far.

Python3 continues to work without any issues.. Is it anything to do with Qt itself? 

**What is the expected output? What do you see instead?**
Upgrade to 3.2.5

**Please provide any additional information below**


## Versions and main components

* Spyder Version: 3.2.4
* Python Version: 2.7.14/3.6.3 (32-bit)
* Qt Version: 4.8.7 for python2 and python3
* PyQt Version: pyQt4 for 2.7.14 and pyQT5 for 3.6.3
* Operating system: Windows 7  


## Dependencies

Please go to the menu entry `Help > Optional Dependencies` (or
`Help > Dependencies`), press the button `Copy to clipboard`
and paste the contents below:

IPython >=4.0;<6.0:  5.5.0 (OK)
cython >=0.21     :  0.27.3 (OK)
jedi >=0.9.0      :  0.11.0 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
numpy >=1.7       :  1.11.1 (OK)
pandas >=0.13.1   :  0.18.1 (OK)
pycodestyle >=2.3 :  2.3.1 (OK)
pyflakes >=0.5.0  :  1.6.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
pylint >=0.25     :  1.7.4 (OK)
qtconsole >=4.2.0 :  4.3.1 (OK)
rope >=0.9.4      :  0.10.7 (OK)
sphinx >=0.6.6    :  1.6.5 (OK)
sympy >=0.7.3     :  1.0 (OK)





Discussion:
Thanks for reporting. Unfortunately, due to the many problems with a `pip` install as you have seen, we only officially support the Anaconda distribution and `conda` for installing Spyder, though you are welcome to try to get it working on your own. Therefore, this issue will have to be closed. Best of luck!
Also, in 3.2.5 we added `pyqt5` as a new dependency for Spyder, and that package is only available for Python 3 on Windows, Linux and macOS.

I think `pip` has a `--no-deps` option or something like that to avoid this, but then you need to manually install `cloudpickle`.
@ccordoba12 , yep, I understand that.  as I said in the original message, Python3 runs without any issues.. 

Thanks for the quick reply and resolution. That is a shame that you only officially support conda. Ohh well, no problem.  👍 
We'll change the pyqt5 pip dependency to be Python 3 only in our next 
release. About us only supporting pip, well, it's a trade we had to make 
to be more effective with our available time.

El 27/12/17 a las 20:02, Ramanunni P Menon escribió:
>
> @ccordoba12 <https://github.com/ccordoba12> , yep, I understand that. 
> as I said in the original message, Python3 runs without any issues..
>
> Thanks for the quick reply and resolution. That is a shame that you 
> only officially support conda. Ohh well, no problem. 👍
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub 
> <https://github.com/spyder-ide/spyder/issues/6075#issuecomment-354207915>, 
> or mute the thread 
> <https://github.com/notifications/unsubscribe-auth/AAWS7RiAxU4CSs8iamrORZSLAj1DtqELks5tEujDgaJpZM4RN4TA>.
>


Can we re-open this bug until the `pyqt5` dependency is set to Python 3 only?
If `pip` is not supportted at all, maybe that can said explicitly in the docs:
https://pythonhosted.org/spyder/installation.html#the-hard-way
@ccordoba12 , that seems like a very fair trade-off.. +1, building from source is not the easiest thing for SIP and PyQt5 for Python2 in Windows, so taking pyqt5 dependency off Python2 would be the best option... for unix systems (I have only tried ubuntu and elementary OS), again, it was not much trouble building everything and putting it together.. 
@xflr6, I don't know if we need to open the bug again, but, it would be good to have it in the documentation, atleast until the update..
> Can we re-open this bug until the pyqt5 dependency is set to Python 3 only?

Fair enough. I reopen it and fix it for 3.2.6.

> If pip is not supportted at all ...

We do support `pip` because we're creating wheels for it. What we don't do is giving support for installation issues with `pip` because they could be generated by a lot of different factors, not related to Spyder at all (e.g. see issue #6023).
>> If `pip` is not supported at all, maybe that can said explicitly in the docs:

> We do support `pip` because we're creating wheels for it. What we don't do is giving support for installation issues with `pip` because they could be generated by a lot of different factors, not related to Spyder at all (e.g. see issue #6023).

If we want a statement making clear that latter point (e.g. something at the top stating that that "Hard Way" mentioned for each OS is doable for an experienced user, but we aren't able to provide direct support if things go wrong) I can whip up a PR. We do get quite the volume of people asking about their `pip` issues as it is; especially around the time new versions are released like 3,2,5; at least a fourth of the issues I've dealt with seem to relate to that.
Sure, please go ahead with that.
Also, a related issue that both myself and @csabella have noticed with regard to the install instructions and `pyqt5` is that installing `requirements.txt` with `conda` also fails with a "can't find pyqt5" because `pyqt5` on PyPI is named `pyqt` on the latter (as you discussed [here](https://github.com/ContinuumIO/anaconda-issues/issues/1554)). Therefore, should I also tweak the instructions and the `CONTRIBUTING.md` file to recommend instead, e.g. just installing spyder normally with `conda` into the environment to get the deps, and then proceeding from there to use the source checkout copy instead?
> should I also tweak the instructions and the CONTRIBUTING.md file to recommend instead, e.g. just installing spyder normally with conda into the environment to get the deps, and then proceeding from there to use the source checkout copy instead?

Sure, the process would be something like

    conda install spyder
    conda remove spyder
    git clone ...
    cd your-clone-dir
    python bootstrap.py
Yup, that's how it did it before. The PR is next in the queue.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -289,7 +289,9 @@ def run(self):
     'pyzmq',
     'chardet>=2.0.0',
     'numpydoc',
-    'pyqt5',
+    # Packages for pyqt5 are only available in
+    # Python 3
+    'pyqt5;python_version>"3"',
     # This is only needed for our wheels on Linux.
     # See issue #3332
     'pyopengl;platform_system=="Linux"'


Test patch: