0

I have been trying a simple code on Pycharm 2019.2.1 on windows 10 (64bit)

'''
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
df = pd.read_csv('covid_19_clean_complete.csv')
X = df[["Deaths"]]
Y = df["Confirmed"]
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=.25, random_state=42)
acr = LinearRegression()    
acr.fit(X_train,Y_train)
print(acr.score(X_test,Y_test))
'''

but showing me this error

error massage

I've already uninstalled pandas once and installed again using pip uninstall pandas and pip install pandas through cmd. pandas installed photo

Interpreter photo

Did much google search but the links I found, were not clear to me(as I faced such problem first). Here's the link OSError: [WinError 193] %1 is not a valid Win32 application

Hope to find a solution. Thank You

Ayon134
  • 23
  • 5
  • have you defined the python interpreter for your project on pycharms? – Rajat Mishra Apr 15 '20 at 17:43
  • 1
    Architecture mismatch. You installed the wrong *NumPy* package (probably installed it manually, as *PIP* correctly selects it). Might check https://stackoverflow.com/questions/57187566/python-ctypes-loading-dll-throws-oserror-winerror-193-1-is-not-a-valid-win/57297745 for more details about the error. – CristiFati Apr 15 '20 at 17:58
  • Mr. @CristiFati, thank you for the link, but I was wondering how can I check if dll is 32 or 64? The python is 64. also, how can I change from 32 to 64. Thank You – Ayon134 Apr 15 '20 at 18:50
  • Mr. @RajatMishra I've defined in pycharm, not in the project. But, should it make any difference? Because I've defined the path. Before this problem, it used to work well. Already I have created an environment in the project folder, still problem remains. – Ayon134 Apr 15 '20 at 18:52
  • For the *.dll*, you can use *Dependency Walker*. For *Python*: https://stackoverflow.com/questions/1405913/how-do-i-determine-if-my-python-shell-is-executing-in-32bit-or-64bit-mode-on-os/50053286#50053286. You can install both *Python* versions. – CristiFati Apr 15 '20 at 19:02
  • Well, I just uninstalled python, PyCharm and all other relevant files from C drive. Then again installed them with modules. Now working pretty well. Though it is not the best way to solve it. – Ayon134 Apr 16 '20 at 03:45

1 Answers1

0

Finally, all I did was uninstall Pycharm and python as well from my system. Obviously, again I had to install those. Then the problem solved.

happy_coding_

Ayon134
  • 23
  • 5