python package version incompatibility even on virtualenv
I am trying to install cuckoo sandbox(malware analysis tool).
I am doing
pip install -U cuckoo as stated in cuckoo documentation, but it gives me following error
pandas 0.23.3 has requirement python-dateutil>=2.5.0, but you'll have python-dateutil 2.4.2 which is incompatible
So I thought maybe there is some package named
python-dateutil and pandas is using its some version which is >= 2.5.0 but cuckoo needs its 2.4.2 version, so to not cause instability it's not getting installed.
So I thought of creating a virtualenv venv and install cuckoo in that. As there are no pandas in
venv/lib/python2.7/site-packages installing a previous version of python-dateutil shouldn't be a problem. But again I am getting the same error. I am not getting where is the problem.
See also questions close to this topic
How to print specific value from specific key from JSON in Python
I wrote 2 functions so I can get champion ID knowing champion Name but then I wanted to get champion Name knowing champion ID but I cannot figure it out how to extract the name because of how the data structured.
so in my code I wrote
['data']['championName'(in this case Aatrox)]['key']to get the champion ID/key. But how can I reverse it if for example I don't know the champion Name but champions ID. How can I get the champion Name if after writing ['data'] I need to write champion Name so I can go deeper and get all the champions info like ID, title etc..
def requestChampionData(championName): name = championName.lower() name = name.title() URL = "http://ddragon.leagueoflegends.com/cdn/8.23.1/data/en_US/champion/" + name + ".json" response = requests.get(URL) return response.json() def championID(championName): championData = requestChampionData(championName) championID = str(championData['data'][championName]['key']) return championID
Pass DataFrame variable name as string
I have the following function to plot a graph:
def plot_ATD(DataFrame): #Initialise 225V ATD plot fig = plt.figure() ax = fig.add_subplot(111) #take columns from data set and make to list which is passed to matplotlib to plot a graph x = DataFrame['Arrival Time (ms)'].tolist() y = DataFrame['Intensity'].tolist() line, = ax.plot(x,y, 'r-') #use numpy to get the max of Intensity, then determine the corresponding arrival time ymax = np.max(y) xpos = y.index(ymax) xmax = x[xpos] time = xmax #add an annotation point at the maxima giving the arrival time at this position # ax.annotate(s=text of annotation, xy=point to annotate, xytext=position to place text # arrowprops=dict(facecolor=color of arrow)) ax.annotate(s=xmax, xy=(xmax, ymax), xytext=(xmax+5, ymax+5), arrowprops=dict(facecolor='orange'), ) #ax.set_ylim(0,600000) ax.set_xlim(0,20) plt.xlabel('Arrival time (ms)') plt.title(DataFrame.name) return plt.show()
I am using it on the following pandas DataFrames:
V100 = pd.read_csv('Documents/spreadsheets/Data/100V_9z.csv', names=['Arrival Time (ms)', 'Intensity']) V125 = pd.read_csv('Documents/spreadsheets/Data/125V_9z.csv', names=['Arrival Time (ms)', 'Intensity']) V150 = pd.read_csv('Documents/spreadsheets/Data/150V_9z.csv', names=['Arrival Time (ms)', 'Intensity']) V175 = pd.read_csv('Documents/spreadsheets/Data/175V_9z.csv', names=['Arrival Time (ms)', 'Intensity']) V200 = pd.read_csv('Documents/spreadsheets/Data/200V_9z.csv', names=['Arrival Time (ms)', 'Intensity']) V225 = pd.read_csv('Documents/spreadsheets/Data/225V_9z.csv', names=['Arrival Time (ms)', 'Intensity'])
I want to have the title of the graph to be the name of the DataFrame i.e. V100, V125 etc.
I am not sure on the right syntax or how to do this? Please help!
Pythonic way to check how many items in a list or combination of items match a condition
Say I have a list like this:
l = [20,17,8,7,4,9]
I would like to check how many items or combinations of items match a value condition.
To check the single items this would do:
minimum_value = 12 count = 0 for item in l: if item >= minimum_value: count += 1
But I also would like to check combinations of that list. Then the count would be 4: 20, 17, 9+4, 8+7
How could I do this?
I wanted to know what kind of linux release I am using but all command says no such file or directory
On mac terminal
DKLEE-MacBook-Pro:~ mac$ grep . /etc/*-release grep: /etc/*-release: No such file or directory DKLEE-MacBook-Pro:~ mac$ cat /etc/*-release | uniq cat: /etc/*-release: No such file or directory DKLEE-MacBook-Pro:~ mac$ grep . /etc/issue* grep: /etc/issue*: No such file or directory DKLEE-MacBook-Pro:~ mac$ rpm -qa *-release -bash: rpm: command not found
How can I find my linux release? Is it centOs or Ubuntu or Fedora...?
Problems installing "rails" in Ubuntu
I am new to programming and trying to install Rails on Ubuntu 18.10, but I get the following error when running $ gem install rails. How do I avoid this error and install rails?
ERROR: While executing gem ... (Errno::EACCES) Permission denied @ dir_s_mkdir - /home/bernardo/.gem/specs
I'm running Ruby 2.5.3p105
How to add tightvncserver to fail2ban rules
I know that it may be risky and it would be better to run tightvnc only behind a ssh tunnel, but I need to use a VPS with tightvncserver, but as you may know sometimes you'll see "too many connection attempts" alert from the client side and then you have to reboot your linux VPS or at least tight VNC server service...
Is there a way to add tightvnc to fail2ban rules to ban an IP after the 1st failed VNC connection attempt?
Not able to install any packages on my Linux test server
Could you please help me? I'm not able to install the below package or any other packages.
obevt021:~ # pip install paramiko Collecting paramiko Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(104, 'Connection reset by peer'))': /simple/paramiko/ Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(104, 'Connection reset by peer'))': /simple/paramiko/ Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(104, 'Connection reset by peer'))': /simple/paramiko/ Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(104, 'Connection reset by peer'))': /simple/paramiko/ Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(104, 'Connection reset by peer'))': /simple/paramiko/ Could not find a version that satisfies the requirement paramiko (from versions: ) No matching distribution found for paramiko
A sure way to tell where Python installed package_data and or data_files
The problem, as far as I can understand it so far, is that if the package (distributed as a wheel) that specifies
package_dataand / or
data_filesis installed by
pip, then these files are copied into
sys.prefix, and if it is installed by
setuptools, then this same data is installed in the package directory under
This is a screwed up situation. And, apparently, the core problem will never be fixed. But, realistically, I want my code to be able to find its accompanied data files.
pkg_resourcesdoesn't work for multiple reasons: (1) it is completely dysfunctional if the package is installed using
pip(it has no idea where to look for data files), (2) half of its API is broken if package is distributed as a wheel / egg and is not unzipped during installation.
However, if you get ready for the bugs in these tools, you can declare your package to be
zip_safe=Falseand, in principle, you could just look in both places, under
pkg_resource.resource_filename(__name__, '.'). The problem is... just finding things at random isn't a great idea because people might have deleted packages by hand w/o realizing there was also package data, and then installed them using a different tool.
So, essentially, unless there is already a way to find where exactly data files ended up being, is it at least possible to tell how the package was installed? Was it installed by
versions in elixir dependencies
What is the difference between declaring a dependency to a package using this syntax: "==1.2.3" (which I understand, it is clearly explained in the spec), and just "1.2.3" (which I also see being used, but it is not explained in the script) ? Is this like a soft constraint, that gives the package manager some freedom to resolve to another version?