|
45 | 45 | }, |
46 | 46 | { |
47 | 47 | "cell_type": "code", |
48 | | - "execution_count": 7, |
| 48 | + "execution_count": null, |
| 49 | + "metadata": {}, |
| 50 | + "outputs": [], |
| 51 | + "source": [ |
| 52 | + "!pip install faststylometry==1.0.15" |
| 53 | + ] |
| 54 | + }, |
| 55 | + { |
| 56 | + "cell_type": "markdown", |
| 57 | + "metadata": {}, |
| 58 | + "source": [ |
| 59 | + "Ideally you should not have to downgrade Numpy. However I can't work out how to force the build process to use the correct version of Numpy. See https://github.com/fastdatascience/faststylometry/issues/5" |
| 60 | + ] |
| 61 | + }, |
| 62 | + { |
| 63 | + "cell_type": "code", |
| 64 | + "execution_count": 15, |
49 | 65 | "metadata": {}, |
50 | 66 | "outputs": [ |
51 | 67 | { |
|
54 | 70 | "text": [ |
55 | 71 | "\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n", |
56 | 72 | "\u001b[0m\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n", |
57 | | - "\u001b[0mCollecting faststylometry==1.0.13\n", |
58 | | - " Downloading faststylometry-1.0.13-py3-none-any.whl.metadata (14 kB)\n", |
59 | | - "Requirement already satisfied: numpy>=2.3.1 in /home/thomas/anaconda3/lib/python3.12/site-packages (from faststylometry==1.0.13) (2.3.1)\n", |
60 | | - "Requirement already satisfied: pandas>=2.3.1 in /home/thomas/anaconda3/lib/python3.12/site-packages (from faststylometry==1.0.13) (2.3.1)\n", |
61 | | - "Requirement already satisfied: scikit-learn>=1.7.1 in /home/thomas/anaconda3/lib/python3.12/site-packages (from faststylometry==1.0.13) (1.7.1)\n", |
62 | | - "Requirement already satisfied: wget>=3.2 in /home/thomas/anaconda3/lib/python3.12/site-packages (from faststylometry==1.0.13) (3.2)\n", |
63 | | - "Requirement already satisfied: python-dateutil>=2.8.2 in /home/thomas/anaconda3/lib/python3.12/site-packages (from pandas>=2.3.1->faststylometry==1.0.13) (2.9.0.post0)\n", |
64 | | - "Requirement already satisfied: pytz>=2020.1 in /home/thomas/anaconda3/lib/python3.12/site-packages (from pandas>=2.3.1->faststylometry==1.0.13) (2024.1)\n", |
65 | | - "Requirement already satisfied: tzdata>=2022.7 in /home/thomas/anaconda3/lib/python3.12/site-packages (from pandas>=2.3.1->faststylometry==1.0.13) (2023.3)\n", |
66 | | - "Requirement already satisfied: scipy>=1.8.0 in /home/thomas/anaconda3/lib/python3.12/site-packages (from scikit-learn>=1.7.1->faststylometry==1.0.13) (1.16.0)\n", |
67 | | - "Requirement already satisfied: joblib>=1.2.0 in /home/thomas/anaconda3/lib/python3.12/site-packages (from scikit-learn>=1.7.1->faststylometry==1.0.13) (1.4.2)\n", |
68 | | - "Requirement already satisfied: threadpoolctl>=3.1.0 in /home/thomas/anaconda3/lib/python3.12/site-packages (from scikit-learn>=1.7.1->faststylometry==1.0.13) (3.5.0)\n", |
69 | | - "Requirement already satisfied: six>=1.5 in /home/thomas/anaconda3/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas>=2.3.1->faststylometry==1.0.13) (1.16.0)\n", |
70 | | - "Downloading faststylometry-1.0.13-py3-none-any.whl (19 kB)\n", |
| 73 | + "\u001b[0mCollecting numpy==1.26.4\n", |
| 74 | + " Using cached numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)\n", |
| 75 | + "Using cached numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.0 MB)\n", |
71 | 76 | "\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n", |
72 | | - "\u001b[0mInstalling collected packages: faststylometry\n", |
73 | | - " Attempting uninstall: faststylometry\n", |
| 77 | + "\u001b[0mInstalling collected packages: numpy\n", |
| 78 | + " Attempting uninstall: numpy\n", |
74 | 79 | "\u001b[33m WARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n", |
75 | | - "\u001b[0m Found existing installation: faststylometry 1.0.11\n", |
76 | | - " Uninstalling faststylometry-1.0.11:\n", |
77 | | - " Successfully uninstalled faststylometry-1.0.11\n", |
| 80 | + "\u001b[0m Found existing installation: numpy 2.3.1\n", |
| 81 | + " Uninstalling numpy-2.3.1:\n", |
| 82 | + " Successfully uninstalled numpy-2.3.1\n", |
78 | 83 | "\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n", |
79 | | - "\u001b[0mSuccessfully installed faststylometry-1.0.13\n", |
| 84 | + "\u001b[0m\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", |
| 85 | + "harmonydata 1.0.5 requires pandas==2.2.2; python_version <= \"3.13\", but you have pandas 2.3.1 which is incompatible.\n", |
| 86 | + "harmonydata 1.0.5 requires scipy==1.14.1; python_version <= \"3.13\", but you have scipy 1.16.0 which is incompatible.\n", |
| 87 | + "gensim 4.3.3 requires scipy<1.14.0,>=1.7.0, but you have scipy 1.16.0 which is incompatible.\n", |
| 88 | + "faststylometry 1.0.15 requires numpy>=2.3.1; python_version >= \"3.12\", but you have numpy 1.26.4 which is incompatible.\u001b[0m\u001b[31m\n", |
| 89 | + "\u001b[0mSuccessfully installed numpy-1.26.4\n", |
80 | 90 | "\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n", |
81 | 91 | "\u001b[0m\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n", |
82 | 92 | "\u001b[0m" |
83 | 93 | ] |
84 | 94 | } |
85 | 95 | ], |
86 | 96 | "source": [ |
87 | | - "!pip install faststylometry==1.0.13" |
| 97 | + "!pip install numpy==1.26.4" |
88 | 98 | ] |
89 | 99 | }, |
90 | 100 | { |
91 | 101 | "cell_type": "code", |
92 | | - "execution_count": 9, |
| 102 | + "execution_count": 16, |
93 | 103 | "metadata": { |
94 | 104 | "scrolled": true |
95 | 105 | }, |
|
192 | 202 | "traceback": [ |
193 | 203 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
194 | 204 | "\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)", |
195 | | - "Cell \u001b[0;32mIn[9], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Corpus\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m download_examples\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m load_corpus_from_folder\n", |
| 205 | + "Cell \u001b[0;32mIn[16], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Corpus\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m download_examples\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m load_corpus_from_folder\n", |
196 | 206 | "File \u001b[0;32m~/anaconda3/lib/python3.12/site-packages/faststylometry/__init__.py:37\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01men\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m tokenise_remove_pronouns_en\n\u001b[1;32m 36\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mburrows_delta\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m calculate_burrows_delta\n\u001b[0;32m---> 37\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mprobability\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m predict_proba, calibrate, get_calibration_curve\n\u001b[1;32m 38\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mexamples\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m download_examples\n", |
197 | 207 | "File \u001b[0;32m~/anaconda3/lib/python3.12/site-packages/faststylometry/probability.py:32\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnumpy\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mnp\u001b[39;00m\n\u001b[1;32m 31\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mpandas\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mpd\u001b[39;00m\n\u001b[0;32m---> 32\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mlinear_model\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m LogisticRegression\n\u001b[1;32m 34\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mburrows_delta\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m calculate_burrows_delta\n\u001b[1;32m 35\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcorpus\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Corpus\n", |
198 | 208 | "File \u001b[0;32m~/anaconda3/lib/python3.12/site-packages/sklearn/__init__.py:73\u001b[0m\n\u001b[1;32m 62\u001b[0m \u001b[38;5;66;03m# `_distributor_init` allows distributors to run custom init code.\u001b[39;00m\n\u001b[1;32m 63\u001b[0m \u001b[38;5;66;03m# For instance, for the Windows wheel, this is used to pre-load the\u001b[39;00m\n\u001b[1;32m 64\u001b[0m \u001b[38;5;66;03m# vcomp shared library runtime for OpenMP embedded in the sklearn/.libs\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[38;5;66;03m# later is linked to the OpenMP runtime to make it possible to introspect\u001b[39;00m\n\u001b[1;32m 68\u001b[0m \u001b[38;5;66;03m# it and importing it first would fail if the OpenMP dll cannot be found.\u001b[39;00m\n\u001b[1;32m 69\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m ( \u001b[38;5;66;03m# noqa: F401 E402\u001b[39;00m\n\u001b[1;32m 70\u001b[0m __check_build,\n\u001b[1;32m 71\u001b[0m _distributor_init,\n\u001b[1;32m 72\u001b[0m )\n\u001b[0;32m---> 73\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mbase\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m clone \u001b[38;5;66;03m# noqa: E402\u001b[39;00m\n\u001b[1;32m 74\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mutils\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_show_versions\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m show_versions \u001b[38;5;66;03m# noqa: E402\u001b[39;00m\n\u001b[1;32m 76\u001b[0m _submodules \u001b[38;5;241m=\u001b[39m [\n\u001b[1;32m 77\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcalibration\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 78\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcluster\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 114\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcompose\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 115\u001b[0m ]\n", |
|
0 commit comments