18

By running:

from sklearn.datasets import fetch_california_housing
import pandas as pd

pd.set_option("precision", 4)  # massimo numero di cifre decimali
pd.set_option("max_columns", 9)  # massimo numero di colonne da visualizzare
pd.set_option("display.width", None)  # larghezza caratteri sul prompt dei comandi

housing = fetch_california_housing()  # carico il dataset (http://lib.stat.cmu.edu/datasets/)
print(housing.DESCR)

i receive an alert and an error:

-------------------------------------------------------------------------------
pydev debugger: CRITICAL WARNING: This version of python seems to be incorrectly compiled (internal generated filenames are not absolute)
pydev debugger: The debugger may still function, but it will work slower and may miss breakpoints.
pydev debugger: Related bug: http://bugs.python.org/issue1666807
-------------------------------------------------------------------------------
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/Users/Alessio/PycharmProjects/Chapter15MachineLearning'])
PyDev console: starting.
Python 3.11.0rc2 (main, Nov  1 2022, 14:05:44) [Clang 14.0.0 (clang-1400.0.29.102)] on darwin
runfile('/Users/Alessio/PycharmProjects/Chapter15MachineLearning/multiLR.py', wdir='/Users/Alessio/PycharmProjects/Chapter15MachineLearning')
Traceback (most recent call last):
  File "/Users/Alessio/.pyenv/versions/3.11.0rc2/lib/python3.11/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 198, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Users/Alessio/PycharmProjects/Chapter15MachineLearning/multiLR.py", line 10, in <module>
    pd.set_option("precision", 4)  # massimo numero di cifre decimali
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Alessio/.pyenv/versions/3.11.0rc2/lib/python3.11/site-packages/pandas/_config/config.py", line 263, in __call__
    return self.__func__(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Alessio/.pyenv/versions/3.11.0rc2/lib/python3.11/site-packages/pandas/_config/config.py", line 156, in _set_option
    key = _get_single_key(k, silent)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Alessio/.pyenv/versions/3.11.0rc2/lib/python3.11/site-packages/pandas/_config/config.py", line 123, in _get_single_key
    raise OptionError("Pattern matched multiple keys")
pandas._config.config.OptionError: Pattern matched multiple keys

I have installed Python 3.11.0 using Pyenv on Mac OS X 12.6.1, with PyCharm 2022.2.3 by setting the interpreter.

(https://i.stack.imgur.com/8uokr.png)

Previously i was using Python 3.10 by a simple installation, but yesterday i have installed Python 3.11 using pyenv because i was having a problem in importing a dataset from sklearn.

I checked the frameworks.python folder and this is the output

(https://i.stack.imgur.com/9FPYp.png)

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Alessio Bolpagni
  • 181
  • 1
  • 1
  • 4
  • 9
    I have the same issue with Python 3.11, I suppose it might be an incompatibility with the current PyCharm/pydev version. – Sigmatics Nov 04 '22 at 11:27
  • Try the following: In the Project pane (left side usually) right click on the project name at the top of the tree and select Clean Python Compiled Files. See if that helps. – Matt Nov 21 '22 at 10:14
  • Doesn't work for me – Belegnar Dec 18 '22 at 10:18

2 Answers2

27

I had a similar problem; updating PyCharm to 2022.3 fixed the issue for me.

mhilden
  • 469
  • 5
  • 10
  • 8
    pycharm was indeed not compatible with python 3.11. The update fixed this. – mke21 Dec 16 '22 at 13:36
  • doesn't work for me also (2022.2.4) – Belegnar Dec 18 '22 at 10:18
  • 3
    @Belegnar you have 2022.2, you should update to 2022.3 or later. – flomaster Dec 28 '22 at 08:05
  • 1
    I hadn't run PyCharm since updating to 3.11 until tonight. Imagine my bug-eyes at the sudden CRITICAL WARNING (like, what does that even mean??). All calmed down now; there's nothing wrong with Python (snicker). This worked just fine. – mojado Jan 18 '23 at 06:23
  • 2
    I updated throug Help -> Check for updates but it didn't work. Had to update manually. – Smit Johnth Feb 22 '23 at 05:42
6

This is an issue with the bundled version of pydev.debugger.

You can fix it by adding -Xfrozen_modules=off in the "Interpreter options:" field of the Run/Debug window.

Screenshot

For more background, check out the GitHub issue.

Chris May
  • 607
  • 7
  • 12